Skip to content

A Less Mad March

Tag: #cli

Missed opportunities for git aliases

I don't pair program very often, but sometimes when you're stuck on a really annoying problem, it can be helpful to have a coworker looking over your shoulder. My new job is fully-remote, so we occasionally screenshare when someone's stuck. One of my favourite things about pair programming is that I get to see the little idiosyncracies of everyone's workflow. For example, you notice which peers use vim for everything, and pick up on all their awesome little keybindings to jump around the document. Or you realize that one peer has installed a bunch of awesome VSCode extensions that you can steal.

Several coworkers have remarked that I use shell aliases way more often than them! For example, I mostly work with rust, so I used alias c="cargo" to tell my shell "when I type c, replace it with cargo". Then I use Cargo's built-in aliases, e.g. cargo check and cargo c are equivalent. So, when I want to run cargo check I just type c c and my shell expands it to cargo c and Cargo expands it to cargo check. My coworkers were very amused by this! I think a suite of nice, easy aliases can really save you time and avoid interrupting your flow state. I'm trying to use more aliases for common tasks, and here's how I've been doing it.