Skip to main content

Why I’m not using Git aliases

Posted in Development and Git

I’ve found my perfect Mac set up. Over the years, I’ve adjusted the trackpad tracking speed so it’s just right, switched to Dark Mode, added Hot Corners to show my desktop, set up my own keyboard shortcuts; that kind of thing.

I know people who go even further, using Apple Script and programs like Keyboard Maestro, customising and automating every little detail of their operating system.

On the other hand, I have a friend who switches on a brand-new Mac and doesn’t change a thing. If a company like Apple, that cares so much about user experience and the right way to do things, decides that the mouse pointer should move a certain speed, that’s good enough for him. One area I wholeheartedly agree with his philosophy is Git commands.

In my (so far successful) quest to ditch the GUI and dig into command line Git my attention has been grabbed a few times by aliases.

Not only do they look like a very quick way of doing things like git remote prune origin, but they’d stop mis-commands like git prune remote origin or git prune origin. It bugs me that pruning doesn’t happen with a fetch, like it does in Tower, so aliasing git fetch && git remote prune origin to gf or something like that would be lovely. But there are a few reasons I don’t want to.

  1. Maybe there’s a good reason for things like my fetch/prune example happening the way it does; as I continue my Adventures in Git™, maybe one day I’ll work it out. People that are way cleverer than me designed it that way, so I trust their judgement.
  2. There’s something in doing a thing properly that appeals to me. I don’t want to take shortcuts – I want to get as close to the metal as possible. I knew CSS extremely well before SCSS came along, and I’ve never been keen on writing JQuery – where possible, give me vanilla JavaScript any day.
  3. If I don’t alias everything, how will I remember what’s an alias and what’s not!?
  4. I like to teach people what I know, so if I start using aliases, I’ll have to translate the aliases I use to the actual Git commands. Sometimes I might refer to the alias accidentally and cost someone time and energy as they work out that the command I’ve given them doesn’t actually exist outside of an alias.
  5. I always liked that Tower uses proper Git terminology, where GitHub Desktop, for example, changes ‘push’ and ‘pull’ to ‘sync’. There’s risk that, with my gf example earlier, I’d forget what is actually happening under the hood.

Aliases feel like the same thing as a GUI – a layer of abstraction. And that’s something I’m looking to get away from.

Subscribe

If you enjoyed reading this and want a monthly roundup of my articles delivered to your inbox, just enter your email below.

I don’t collect any data on when, where or if people open the emails I send them. Your email will only be used to send you newsletters and will never be passed on. You can unsubscribe at any time.

More posts

Here are a couple more posts for you to enjoy. If that’s not enough, have a look at the full list.

  1. Using Pandoc to convert Markdown to Jira’s Textile in Sublime Text

    It’s a real pain that Jira’s plain text input isn’t Markdown. Here’s how to I write in Markdown and export to Jira’s version of Textile.

  2. Apple dials back the Safari 15 for macOS redesign

    The ultra-condensed tab bar in the up-coming Safari for macOS has been reverted in the betas; it’s now just an option in Safari’s Preferences.