Re:Show HN: Switch Git Users CLI
by lilyball on Thursday November 12, 2020 @04:44PM
(#25075491)
Huh I had no idea $1/$2/etc worked as-is in an alias. The advice I learned years ago for dealing with any alias that needs to do something custom with parameters is to write it like
as that will pass all the args to the shell function. But if git is already setting it up so the args work then suffixing the alias with ";:" seems simpler.
[ Parent
| on HN ]
> The advice I learned years ago
Being able to use $1/$2/etc directly might be a relatively new development.
EDIT: Or maybe not. This might have been doable since 2010:
https://github.com/git/git/commit/8dba1e634af1d973a47fca616a...