Skip to content

Fork, Clone, Remote and Pull Request

Isabel Costa edited this page Feb 10, 2021 · 2 revisions

To contribute to the project you may work on the frontend or backend of the project.

Fork the repo

Forking Click on the Fork button. This will create your copy of the repo on GitHub.

Clone

After forking, run the following commands in your terminal:

git clone https://github.com/<your-github-username-here>/open-source-programs-web

OR

git clone https://github.com/anitab-org/open-source-programs-web

Add Remote

If you have forked and cloned the repo, on entering git remote -v you should see the following output:

$ git remote -v
origin  https://github.com/<your-github-username-here>/open-source-programs-web (fetch)
origin  https://github.com/<your-github-username-here>/open-source-programs-web (push)

Now you need to add another remote named upstream (you may change if you wish, but this is a git convention). Run this command:

git remote add upstream https://github.com/anitab-org/open-source-programs-web

The output of git remote -v now changes to:

$ git remote -v
origin  https://github.com/<your-github-username-here>/open-source-programs-web (fetch)
origin  https://github.com/<your-github-username-here>open-source-programs-web (push)
upstream  https://github.com/anitab-org/open-source-programs-web (fetch)
upstream  https://github.com/anitab-org/open-source-programs-web (fetch)

Working on an Issue

Now that you have setup the project, you need to search for anything to work on which interests you. Have a look at the Backend Issues or Frontend Issues, whichever interests you.

  • Once you find an unassigned issue that you wish to solve, comment below the issue asking whether you should work on it or not.
  • Wait for a Mentor/Admin to assign it to you and start working on it.

Making a Pull Request

After working on an issue, adding relevant documentation and tests, you need to push your changes to your forked repository and make a pull request. You should always push your changes in a different branch (not master).

git checkout -b <new-branch-name>

Make the relevant changes and then commit with a proper message:

git add -a
git commit -m "<your-commit-message-here>"

Now push the changes:

git push origin <new-branch-name>

Now in the GitHub repo click on New Pull Request Screenshot from 2020-05-15 19-08-12 Choose the branch you pushed. Make your PR informative by adding screenshots, Issue link and descriptive details regarding what it does and then submit it.

Note: For more detailed understanding visit this page.

Congratulations! You have contributed to AnitaB.org Open Source successfully.