Modernized Git Alias
·1 min
Git keeps evolving, and these days switch is preferred over checkout. Some of my older aliases still use checkout 😄
In my old post git-alias-and-then-some I had the following list:
st = status -s
aa = add -A
cm = commit -m
ups = commit -a --amend
co = checkout
cob = checkout -b
dh = diff HEAD
wdiff = diff -w --word-diff=color --ignore-space-at-eol
ls = log --pretty=slog --decorate --date=relative
ll = log --pretty=slog --decorate --date=relative --numstat
fl = log -u
start = !git init && git commit --allow-empty -m \"Initial commit\"
That can easily be updated a bit to the following:
st = status -s
aa = add -A
cm = commit -m
ups = commit -a --amend
sw = switch
sn = switch -c
sm = switch main
dh = diff HEAD
wdiff = diff -w --word-diff=color
ls = log --pretty=slog --decorate --date=relative
ll = log --pretty=slog --decorate --date=relative --numstat
fl = log -u
start = !git init && git commit --allow-empty -m \"Initial commit\"
A fast and easy conversion that does the same thing. I could easily have retained my old alias, but I think I’ll survive learning the new alias and relate it to the underlying method.