Skip to main content

Modernized Git Alias

·2 mins

It’s no surprise that all software is evolving, even git is evolving these days which I guess relates to having become a very broad used tool.

Some of my older aliases is leveraging checkout but these days it’s all about switch 😄

In my old post git-alias-and-then-some I had the follwoing 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.