My favorite is git h
, which produces a nicely summarized log of commits on the current branch, with some highlighting and relative dates:
[alias]
h = log --graph --abbrev-commit --date=relative --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
What’s your favorite Git alias?
git config --global alias.git '!git'
Now if you dogit git status
by mistake you won’t get an error lol. I believe this is the most universally useful and unopinionated alias.The
!
makes it treat it as a shell command instead of a git command. Then because it is git it just basically runs the remainder as a git command lol.Love it. I might also do
igt
(as inid-jit
), which is what I call myself when I typo that.And
gti
. Apparently one cannotpush
a Golf GTI from command line.Would you commit a car?!?!
I don’t think so. One would need to download it first.
You can’t stop me!