Reputation: 61
This is my alias to create branch and set upstream on that branch later on:
create = !sh -c \"branch=$(git branch | peco)
&& git fetch origin ${branch}:${1}
&& git checkout $1
&& git branch -u origin/$(git current) fix/$1\"
But no matter I execute the follow command, it keeps showing syntax error, like this: new-branch-name: develop: command not found
What do I need to do to make the above alias works? Thanks a lot!
Upvotes: 3
Views: 353
Reputation: 142034
There is not such a command name current
in git..
create = !sh -c \"branch=$(git rev-parse --abbrev-ref HEAD) && git fetch origin ${branch}:${1} && git checkout $1 && git branch -u origin/$(git rev-parse --abbrev-ref HEAD) fix/$1\"
create = !sh -c \"branch=$(git rev-parse --abbrev-ref HEAD)
&& git fetch origin ${branch}:${1}
&& git checkout $1
&& git branch -u origin/$(git rev-parse --abbrev-ref HEAD) fix/$1\"
Upvotes: 1