Re: Branch name support & character
- Date: Thu, 7 Sep 2017 15:31:33 +1000
- From: Andrew Ardill <andrew.ardill@xxxxxxxxx>
- Subject: Re: Branch name support & character
On 7 September 2017 at 13:27, 夏大雨 <xia.jason23@xxxxxxxxx> wrote:
> I want to merge branch a to branch b so I rename branch b to a&b, but
> when I push a&b to remote repo, '&' is took as & operator for shell,
> and git push fails. So it would be better that branch name support &
> character for me.
Have you tried quoting the branch name?
Using git checkout -b 'my&branch' works for me (single quotes around
the branch name).
Pushing to a local remote also works: git push --set-upstream
That being said, I would advise not using & in branch names,
specifically because it is a special character in shells.