Git Alias - Multiple Commands and Parameters
This will work (tested with zsh and bash):
[alias] chs = !git checkout $1 && git status
This targets Windows batch / msysgit bash; might not work on other environments.
As Olivier Verdier and Lily Ballard have said
[alias] chs = !git checkout $1 && git status
almost works, but gives a spurious extra insertion of the argument ...
git chs demo -> git checkout demo && git status demo
But if you add && :
to the end of your alias, then the spurious argument is consumed into a location tag.
So
[alias] chs = !git checkout $1 && git status && :
gives the correct output ...
git chs demo -> git checkout demo && git status