Taken from : https://code.tutsplus.com/tutorials/how-to-collaborate-on-github--net-34267
-
Forking Fork the repo on GitHub.com
-
Cloning Clone the repo using the URL in the right sidebar:
git clone [email protected]:jcutrell/jquery.git
- Adding the Upstream Remote Change into the cloned directory and then at this point, you can add the upstream remote:
cd jquery
git remote add upstream [email protected]:jquery/jquery.git
This will now allow you to pull in changes from the source locally and merge them, like so:
git fetch upstream
git merge upstream/master
- Checking Out a Topic Branch However, before you make your own changes, checkout a topic branch:
git checkout -b enhancement_345
- Committing Now, you can make your changes, and create a commit that tracks just those changes.
git commit -am "adding a smileyface to the documentation."
- Pushing Next, you'll push this topic branch to your own fork of the project.
git push origin enhancment_345
- Creating a Pull Request Finally, you will create a pull request. First, go to your fork of the repo. You might see a "your recently pushed branches", and if so, you can choose "Compare and Pull Request". Otherwise, you can select your branch from the dropdown, and subsequently click "Pull Request" or "Compare" at the top right of the repo section.
$ git remote -v # prints remotes fetch/push URLs
$ git fetch upstream
$ git checkout master # goto master branch
$ git merge upstream/master
# ...
# ( $ git pull upstream master )