If you find git confusing, I created this little cheat sheet! Please, note that I voluntarily
skipped the basic commands like git commit, git pull/push… This cheat sheet is intended for
advanced usage of git.
🧭 Navigation - Go to the previous branch
🔍 Get the history
🙈Ooops #1: I reseted an unwanted commit. How to rollback?
Leave the first “pick” and replace the rest by “squash” (or “s”)
Tidy up the commit message and save (:wq in vi).
🎯Fixup
Let say I want to add something in the commit fed14a4c
🕹Execute command on each commit when rebasing
For massives features, you might end up with a branch with a few commits inside. And then tests are
failing and you want to identify the “guilty commit”. You can use rebase --exec to execute a
command on each commit of the history.
🦋Stash
Because it’s not all about git stash and git stash pop ;)
🗑 Clean
🐙 GitHub = Git + Hub
I use Hub as a wrapper for git. To enable it you’ve to set hub as
an alias for git (alias git='hub').
Hey, I'm Maxence Poutord, a passionate software engineer. In my
day-to-day job, I'm working as a senior front-end engineer at Orderfox.
When I'm not working, you can find me travelling the world or cooking.