DEV Community

Discussion on: Useful Git Alias

Collapse
skittishsloth profile image
Matthew Cory

My bash (and git) skills are lacking, so this may be obvious, but why are you declaring functions in the aliases just to immediately call them? Is it not possible to have the full commands as an alias without the function wrapper? Good stuff though :)

Collapse
committedsw profile image
Committed Software Author • Edited on

Basically, you need to do that when you want to work with the arguments. Otherwise, all the arguments go to whatever the last command in the alias is.

Collapse
skittishsloth profile image
Matthew Cory

Ah, okay - that makes sense. Thanks for clearing that up!