-1

I am new to github and open source.

I just wanted to know that which of the following is the correct way of contributing to someone's​ project ?

A. Fork the project so that it shows under your account and then make the changes in it. Finally, creating a pull request.

OR

B. Make a branch into the original project's repository (without forking) and then making your changes into that branch. Finally, creating a pull request.

I googled but couldn't find it. Thanks in advance.

dharmik
  • 11
  • 3
  • 1
    If it's someone else's project, you won't have access to create a branch for option B. – SLaks Aug 24 '17 at 16:18
  • If you don't have access to create a branch in the original repository, that is when you create a fork and then PR. – Saravana Aug 24 '17 at 16:20

1 Answers1

3

Have a good read of the GitHub documentation at:

As discussed in the comments, without write access to the repository you want to contribute to it's best to fork the project and send a PR based off your fork.

One great bit of advice from GitHub is the following:

We recommend that you make changes in a topic branch, so that you can push followup commits if you receive feedback on your pull request.

This also allows you to continue development on the master branch of your fork without making changes to your open pull request.

Samuel Parkinson
  • 2,992
  • 1
  • 27
  • 38