First Open Source Contribution to GitHub – A Step By Step Guide

Contributing to open-source projects on GitHub is a rewarding experience that allows you to collaborate with developers worldwide, improve your skills, and make a positive impact on the tech community. This step-by-step guide will walk you through the process of making your first open source contribution to GitHub, from finding a project to submitting a pull request.

Why Contribute to Open Source?

  • Skill Improvement: Enhance your coding skills by working on real-world projects.
  • Networking: Connect with other developers and build your professional network.
  • Community Impact: Contribute to projects that many people use and rely on.
  • Portfolio Building: Showcase your contributions to potential employers or clients.

Step By Step Guide

Step 1: Fork the desired repository. We have to contribute to the js-hindi repository, so we forked the js-hindi repository first, then entered Create Fork.

First Open Source Contribution to GitHub – A Step By Step Guide

Step 2: Then create a folder for the repository you want to contribute to.

First Open Source Contribution to GitHub – A Step By Step Guide

Step 3:

  • Open the terminal/command prompt(If you are using Windows) and type git clone for cloning the repository (git clone “the link of the repository which is a fork”).
  • cd Repository name
  • Make the changes in other repositories as you want to change.
  • Type these commands in the repository as mentioned below.

First Open Source Contribution to GitHub – A Step By Step Guide

First Open Source Contribution to GitHub – A Step By Step Guide

Why are these commands used to commit?

  1. git clone : A git clone is primarily used to point to an existing repository and make a clone or copy of that repository in a new directory at another location.
  2. cd : To change this current working directory.
  3. git remote add upstream : We use git remote add upstream to specify the remote repository from which we want to pull changes or updates (“git remote add upstream “remote repository link from which you want to pull changes”).
  4. git remote : We use ‘git remote’ to manage the remote repositories associated with our local Git repository.
  5. git pull upstream main : We use git pull upstream main to fetch and merge changes from the upstream repository’s main branch into our local repository’s current branch.
  6. git checkout -b : We use ‘git checkout -b’ to create a new branch and switch to it at the same time(git checkout -b “New branch name”).
  7. git branch -a : We use ‘git branch -a’ to list all the branches in our local repository as well as the remote repositories that are currently available.
  8. git add . : We use ‘git add .’ to stage all changes in the current directory and its subdirectories for the next commit.
  9. git commit -m : We use ‘git commit -m’ to create a new commit with a message that describes the changes we’ve made(git commit -m “Write the message for the author about what you had changed in the repository”).
  10. git remote -v : We use ‘git remote -v’ to display a list of all the remote repositories that are currently associated with our local Git repository.
  11. git push -u origin : We use ‘git push -u origin’ to push our local changes to the origin remote repository and set it as the default upstream branch for the current branch(git push -u origin “the new branch name that you created”).

Compare and Pull request

First Open Source Contribution to GitHub – A Step By Step Guide

Enter the compare & pull request.

Create Pull Request

First Open Source Contribution to GitHub – A Step By Step Guide

Leave a comment and then enter Create pull request, and your first pull request is generated. Now the author will check the changes you made, and if he finds them correct, he will accept your pull request; if they don’t find them correct, they will suggest that you make the changes in your commit.


Contact Us