DEV Community

Discussion on: The case against aliases

Collapse
 
pbnj profile image
Peter Benjamin (they/them) • Edited

I have also seen some really long/complex-looking git aliases that are really hard to follow, like:

[alias]
  foo = !"f() { some; really && long | function onliner || with lots of $(sed) && awk '{print $1}' && then call --it at 'the' end ; } ; f"
Enter fullscreen mode Exit fullscreen mode

For these cases, I would recommend creating an executable script placed somewhere in your $PATH named git-foo and git will expose this as a subcommand, like $ git foo. Just like git-extras.

Thread Thread
 
ferdnyc profile image
Frank Dana

Agreed, as an alias abuse that's just obnoxious.