Ramblings of an aging IT geek
← Ramblings of an aging IT geek
tooling

git aliases that earn their keep

A handful of git aliases I type dozens of times a day, and why the boring two-character ones save more time than the clever ones.

A keyboard glowing in front of a terminal

Most "share your git aliases" posts show off the clever ones: some forty-character pretty-log incantation the author copied from a gist and uses twice a year. Mine are boring, and that's the point. The aliases that earn their keep are the two-character ones for commands you run forty times a day.

Here's the section of my .gitconfig that actually pays rent:

[alias]
    st = status -sb
    co = checkout
    br = branch
    ci = commit
    df = diff
    dc = diff --cached
    lg = log --oneline --graph --decorate -20
    unstage = reset HEAD --

st for status -sb gets the short, branch-aware status I want, not the verbose default with its three paragraphs of advice. dc for diff --cached is the one I'd never give up: reviewing exactly what I'm about to commit, every single time, before I commit it. unstage exists purely because I can never remember that reset HEAD -- is how you take something back out of the staging area, and naming it after what it does means I no longer have to.

The maths is dull and convincing. Save four keystrokes on something you type fifty times a day and you've saved real friction, not because the seconds add up to much, but because the command stops interrupting your thought. That's the actual win: the boring alias disappears into muscle memory and gets out of your way. The clever ones never do.