Git commands to contribute to openSource

Milind Yadav
1 min readMay 19, 2022

Pre-requisite git installed on local machine

  1. Fork your favorite repo .
  2. Clone the forked repo to your local machine .
  3. set up upstream to submit pull requests .
    git remote add upstream <url of the actual repo forked from>
  4. Validate if origin and upstream are set properly .
    git remote -v
    Output would be like —

origin git@github.com:<yourname>/<forked-projectname>(fetch)
origin git@github.com:<yourname>/<forked-projectname> (push)
upstream https://github.com/<ownerRepo>/<projectname> (fetch)
upstream https://github.com/<ownerRepo>/<projectname> (push)

5. Once above is set checkout the origin master branch using -

git checkout -b feature1

6.Make your changes to the feature1 branch

git add <files>

git commit -m “Read me made more clearer , corrected the dormant link”

git push origin feature1

7.Go to the github page of the original repo(not the forked one) , you will see notification to open the Pull request .

Follow along and open the Pull request .

You have made your first PR and the owner of the repo will review and provide feedback and merge the change to the repo if its appropriate.

8. For the next change you can pull the upstream master to your local create new branch and follow the same steps .

Above should help anyone interested in opensource to start making contributions , there is a sea of projects available to contribute to.

I use exactly same steps to make contributions — https://github.com/miyadav

--

--