Tuesday, 20 August 2013

git alias not working properly

git alias not working properly

I have a git alias that is supposed to do a git checkout -b <branchname>
(basically create the branch and check it out). My alias looks like:
newbranch = !sh -c 'git checkout -b "$1"'
But when I try git newbranch mytestbbranch I get an error saying that the
"b" switch requires an argument.
I have a similar alias for rename that looks like:
rename = !sh -c 'git branch -m "$1" "$2"'
And that one works just fine. I'm confused why the newbranch alias isn't
working.

No comments:

Post a Comment