4

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

1
  • 2
    Note that this isn't a git question at all; your shell never runs git because it can't understand what you typed. Commented May 9, 2012 at 12:51

2 Answers 2

12

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!).

Sign up to request clarification or add additional context in comments.

Comments

2

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.