Skip to content

Instantly share code, notes, and snippets.

@acoomans
Last active September 3, 2015 16:30
Show Gist options
  • Save acoomans/571145049cfbc1533ae1 to your computer and use it in GitHub Desktop.
Save acoomans/571145049cfbc1533ae1 to your computer and use it in GitHub Desktop.
Git cheat sheet

Git

Author fix

rebase, mark the commit as 'edit'

amend:

git commit --amend --reset-author

Branch differences

git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative BRANCH1..BRANCH2

Search

git branch --contains COMMIT

Stats

changes CSV:

git log -10000 --shortstat --pretty=format: | grep -v '^$' | sed -E 's/files? changed|insertions?\(\+\)|deletions?\(\-\)//g' > gitlog.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment