A useful collection of Git commands Back
-
List all authors inside a project:
git shortlog --summary --numbered --email
git shortlog -sne
To show all branches:
git shortlog -sne -all
-
List logs with a colourful graph:
git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ai) %C(bold blue)<%an>%Creset' --abbrev-commit
-
Squash all commits into one:
!f(){ git reset $(git commit-tree HEAD^{tree} -m \"${1:-A new start}\");};f "commmit message"
-
Show lines of differences between two commits:
git diff --shortstat