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.

Accessibility in your inbox

I send an accessibility-centric newsletter on the last day of every month, containing:

  • A roundup of the articles I’ve posted
  • A hot pick from my archives
  • Some interesting posts from around the web

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. Images as the first thing in a button or link

    If the text of an interactive element like a button or link is preceded with an accessible image, we’ve probably got an accessibility problem.

  2. Alt text for CSS generated content

    There’s an interesting feature in Safari 17.4 that allows content added with CSS to have ‘alt’ text. I’m not sure how I feel about this.