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.
![]()
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.