My GitHub Cheat Sheet
Some git commands that I’ve been using the most while working with projects on GitHub:
Standard stuff:
git add file.ext git status git commit -am "Message" git push origin master
To create a patch:
git clone git://github.com/user/project.git cd project git checkout -b fix_something (fix that something) git commit -a -m "Fix something" git log git format-patch master --stdout > fix_something.patch
To tag:
git tag -a v1.2.3 -m "Tag v1.2.3" git push --tags git@github.com:user/project.git
To merge from another branch:
git remote add --track master project git://github.com/otheruser/otherproject.git git remote git fetch project git merge project/master (resolve any conflict) git commit -a -m "Merge from otheruser/otherproject" git push git@github.com:youruser/yourproject.git
To bisect:
git bisect start git bisect good a1217cdc2e05dfd5672b git bisect bad HEAD git bisect run command.sh