Git: unrecognized branch name

In git, I named the branch: parse ()

The name is accepted, but when merging I get an error message:

git merge parse () bash: syntax error near unexpected token '('

Is it possible to rename a branch? Are there other ways to solve this problem?

Thank!

Platform: Linux, bash

+3
source share
2 answers

Try merging by placing quotation marks around the branch name, for example:

git merge 'parse()'

You can rename a branch, but it is not so simple. Wherever you want to use the branch name, just use quotation marks (single or double!).

+4
source

You can rename a branch using:

git branch -m 'parse()' your_new_branch_name

(see Switch Names in git )

, ( bash) . [-_a-zA-Z0-9].

+2

All Articles