Git Cheat Sheet

tl;dr I made a comprehensive cheat sheet for daily work with Git commands.

Git is super cool to use and I prefer the commandline over any GUI. But some of the commands are confusing and non-descriptive.

For example git pull is a shortcut for git fetch && git merge. But the shortcut for git branch <some-branch> && git checkout <some-branch> is git checkout -b <some-branch>. The command to delete a local branch is git branch -d <some-branch> while deleting remote branches is done with git push origin :<some-branch>. It is not obvious why some commands have options and some dont. A few commands even have complete different outcomes based on given filenames.

So there was a need for me to have a cheat sheet around, which I may pass to my colleagues and students as well.

Git Cheat Sheet screenshot

The cheat sheet is available as HTML to bookmark it and PDF to print it and put it on your desk.

It also includes a list of best practices while working with Git.

The cheat sheet is written with Markdown and hosted on Github, so feel free to improve it by sending pull requests.

⌛ Warning! This post is old. The information may be outdated.

No comments on this notepad. If you would like to add something, then dont hesitate to contact me via E-Mail or Twitter.