logo

Better git shell aliases

Better git shell aliases: using an external shell script 10 years ago, I read this blog post on GitHub Flow git aliases by Phil Haack. From it, I learned a few really clever tricks. Even though I never much cared for using ‘GitHub Flow’ as a git workflow, I used some of those tricks for my own git aliases. One of those being this basic pattern: [alias] foo = "!f() { echo "foobar: $@"; }; f" This lovely little mess of an alias embeds a one-line shell function tersely named “f” directly into a git command.
8 minutes to read