Appendix D Cheat sheet for contributing to a project
You have forked a repository and cloned your fork to your laptop. You have origin
as a remote to your fork, and upstream
as a remote to the official repository for the project. Below are all the steps you typically need for contributing to the project.
List D.0.1.
git checkout master
git pull upstream master
Now you are on your master branch and have the latest version of the project.
git branch <branchname>
git checkout <branchname>
Now you are on a new branch called <branchname>.
Make the changes you planned. When appropriate do
git add <file1> <file2> ...
git commit -m "useful commit message"
Check your work: run latex
, or compile the code, or whatever is appropriate for the project. Save yourself the embarrassment of having a pull request rejected because you submitted something broken!
git pull upstream master
Do that in case new material has been added since the last time you pulled. If you pulled in new material, it can’t hurt to repeat step
Item D.0.1:6 .
git push origin <branchname>
And then go to your fork on GitHub and make a pull request..
Be sure to describe how to see your changes in the final product.
When in doubt, do git status
to find out what branch you are on, and to see if there are uncommitted changes.