
I have been accumulating Git aliases for years. Most of them are junk — things I set up once and never used again. But a handful have become so embedded in my muscle memory that I genuinely forget the full commands they replace.
Here are the ones that survived the cut. No novelty, no cleverness — just the aliases I actually type multiple times a day.
The essentials
git co for checkout. Obvious, boring, saves keystrokes hundreds of times a week. Same deal with git br for branch and git st for status. If you are still typing the full words, start here.
git lg — this one maps to a custom log format: one-line, graph view, with relative dates and author names. The default git log output is borderline unusable. A good lg alias turns it into something you actually want to look at.
git undo — aliases to reset HEAD~1 --mixed. Undoes the last commit but keeps the changes staged. I use this probably once a day when I commit too early or with the wrong message. Having it as a single word removes the friction of remembering the reset flags.
The essentials share a property: they replace commands you already type constantly, not commands you wish you typed. That is the test for whether an alias earns its place. If you have to remember the alias exists, it has not earned it. If you reach for it without thinking, it has.
The workflow ones
git wip — stages everything and commits with the message “WIP”. For when I need to switch branches fast and do not want to stash. I always squash these later, but having a one-word “save my current state” command is invaluable.
git cleanup — deletes all local branches that have been merged into main. Run it once a week and your branch list stays manageable. The underlying command is ugly enough that I would never type it from memory.
git recent — shows the 10 most recently checked-out branches. When you are juggling multiple features and reviews, this is faster than scanning the full branch list. I stole this from a coworker and it immediately became essential.
Workflow aliases are different from essential ones: they encode a habit, not just a shortcut. git wip encodes “save state before switching.” git cleanup encodes “prune weekly.” git recent encodes “return to what you were doing.” Each one is a small piece of process, made cheap enough to actually follow.
The dangerous one
git yolo — add -A && commit -m "yolo" && push. I use this exclusively for personal projects and throwaway branches. It exists because sometimes at 11pm you just want to push the thing and go to bed. Not for production. Definitely not for production.
I include it because it is honest about how people actually work, and because its danger is bounded by a rule: personal projects only. Every team needs a shared understanding of which shortcuts are safe where. A shortcut with a clear boundary is a tool. The same shortcut without one is a liability. The rule is the tool, as much as the alias is.
Why aliases matter more than you think
The argument for aliases is not really about saving keystrokes. It is about reducing the friction between intention and action. When “undo the last commit” is a single word instead of a command you have to look up, you do it without hesitation. That changes how you work — you commit more often, experiment more freely, and recover faster.
The best dev tools are not the ones that do the most. They are the ones that make the simple things instantaneous.
That principle is why I keep my alias list short. Every alias I add is a word I have to remember, and memory is a budget. The aliases that survive are the ones that pay for themselves dozens of times a week. The rest were experiments, and experiments that do not earn their keep get deleted. A short alias list is not a lack of ambition. It is the result of years of pruning.
How I prune the list
The list above is short because pruning is a regular habit, not a one-time event. Every few months I look at my aliases and ask which ones I actually used. The ones I cannot remember using get deleted, even if they seemed clever when I added them. Cleverness is not the test. Use is the test, and use is easy to measure: either you typed it this month, or you did not.
That habit also keeps the list learnable. A new teammate, or a future version of me returning after a break, can read a short list and understand it in minutes. A long list of clever aliases is a private language that only its author speaks, and private languages are a cost, not an asset, in shared work.
The same pruning logic applies to tools generally, and it is why my editor config, my tmux config, and my alias list are all short. Every tool I keep is a tool I have to maintain, remember, and explain. The fewer I keep, the better I know the ones that remain. Aliases are a small example of a general principle: the best setup is not the one with the most features. It is the one where every feature earns its place, every month, by being used.
A note on sharing aliases
If you adopt any of these, adopt them one at a time, and give each one a week before adding the next. Muscle memory is built by repetition, not by reading a list. The aliases that stuck for me are the ones I used until I forgot the original command, and that forgetting took time. There is no shortcut to it, which is fitting: the point of an alias is to save time later, and the price is a little time now.
Setting them up, briefly
For completeness, aliases live in your git configuration, usually under an alias section, and they take a few minutes to set up once. The exact syntax is well documented in git's own help, and I am deliberately not turning this post into a configuration tutorial, because the configuration is the easy part and the habit is the hard part. What matters is not how you define an alias, but whether you use it until it replaces the original command in your fingers. Start with the essentials above — checkout, branch, status, and a readable log — and add the workflow ones only after the essentials are automatic. A small list you actually use will always beat a long list you have to look up, and looking up an alias defeats its entire purpose.
One more practical note: keep your aliases in a dotfiles repository if you use more than one machine. An alias that only exists on your laptop is an alias you will miss the first time you sit at another machine, and re-creating it from memory is exactly the friction aliases are supposed to remove. Version-controlled dotfiles solve that, and they have the side benefit of making your setup reproducible for anyone else who wants to borrow it.