Git Cheatsheet
Some Git commands
Shorthands
HEAD
Latest commitHEAD^
ORHEAD~1
commit before latest commit
Branching
git mergetool
use the installed mergetool to resolve conflictsgit cherry-pick -n HASH
checrry-pick a single commit-n
prevents it auto adding a commit
History
git log --oneline
gives a one log history
Diff
Revert
git revert -n HEAD
revert the last commit - always revert backwards
Reset
git reset --hard HEAD
Tagging
git tag
Submodules
git submodule add GITURL REPO
git submodule init REPO
git submodule update REPO
Reflog
git reflog
Bisect
bisects the commit to find where the bug was addeded in
git bisect start
git bisect bad
git bisect good