2 MIN READ · JUL 15, 2026
Git's default commands aren't long, but you type them dozens of times a day — which is exactly why shaving them down adds up. Aliases turn your most-used commands into something you can type without thinking.
Git aliases are just entries in your .gitconfig file, usually at ~/.gitconfig on Mac/Linux or C:\Users\you\.gitconfig on Windows. You can add them by hand, or use git config --global alias.NAME "command" from the terminal — both end up in the same place.
Add these under a [alias] section in your .gitconfig:
st = status — the single most-typed Git command, now three keystrokes shorter.co = checkout — for jumping between branches all day.br = branch — quick list of local branches.cm = commit -m — pairs naturally with a quoted message right after.last = log -1 HEAD — shows your most recent commit without scrolling through history.git config --global alias.st status writes the exact same line into your .gitconfig — useful if you don't want to open the file directly.
Git's default log output is verbose and hard to scan. This alias compresses it into one line per commit, with a bit of color and a graph of branches:
lg = log --oneline --graph --decorate --all
Run git lg and you'll get a compact visual history that's actually readable at a glance — genuinely one of the highest-value aliases you can set up.
undo = reset --soft HEAD~1 rolls back your most recent commit but keeps all the changes staged, ready to re-commit differently. It's the alias to reach for when you commit too early or write a bad message.
Comments