Git Cheatsheet
Some Git commands
Shorthands
HEADLatest commitHEAD^ORHEAD~1commit before latest commit
Branching
git mergetooluse the installed mergetool to resolve conflictsgit cherry-pick -n HASHchecrry-pick a single commit-nprevents it auto adding a commit
History
git log --onelinegives a one log history
Diff
Revert
git revert -n HEADrevert the last commit - always revert backwards
Reset
git reset --hard HEAD
Tagging
git tag
Submodules
git submodule add GITURL REPOgit submodule init REPOgit submodule update REPO
Reflog
git reflog
Bisect
bisects the commit to find where the bug was addeded in
git bisect startgit bisect badgit bisect good