In git, I named a branch: parse()
The name has been accepted, but when merging I get the error:
git merge parse() bash: syntax error near unexpected token '('
Is it possible to rename a branch? Are there other ways to fix this problem?
Thank you!
Platform: Linux, bash
Try merging by putting quotes around the branch name instead, e.g.:
git merge 'parse()'
You can rename a branch, but it's not so straightforward. Wherever you want to use the branch name, just use quotes (single or double!).
You can rename a branch using :
git branch -m 'parse()' your_new_branch_name
(see Switch branch names in git)
You should also note that using parenthesis in branch names (or any special bash character) will only cause you problems. I would recommend using only [-_a-zA-Z0-9]
characters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With