Why I’m not using Git aliases
11th September 2019
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.
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.
- 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.
- If I don’t alias everything, how will I remember what’s an alias and what’s not!?
- 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.
- 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
gfexample 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.
If you enjoyed this post and want to know when the next one is published, head to Twitter and hit ‘Follow’.@tempertemper
Or read more articles