I am trying to create an alias that uses both multiple Git commands and positional parameters. There are Stackoverflow pages for each, and it would appear painfully obvious to do both, but I am having trouble.
As an example, I want to switch to branch foo and perform a status. So in my .gitconfig
, I have:
[alias]
chs = !sh -c 'git checkout $0 && git status'
which doesn't work. Whereas something like this will work.
chs = !sh -c 'git checkout $0'
echoes = !sh -c 'echo hi && echo bye'
Any insight would be appreciated.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…