Having brackets in git branch name breaks checkout


#1

Having brackets in git branch name breaks checkout as it breaks the bash script syntax:

if [ -n "$CIRCLE_TAG" ]
then
  git fetch --force origin "refs/tags/${CIRCLE_TAG}"
else
git fetch --force origin fix(something)reason:remotes/origin/fix(something)reason
fi

results in:

Checking connectivity... done.
/bin/sh: 38: Syntax error: "(" unexpected (expecting "fi")
Exited with code 2

#2

Thank you for sharing this, I ran into the same with a branch name that had parentheses — was tearing my hair out all afternoon!


#3

I also ran into the issue with two forward slashes. Is this forum dead? Would have expected a response by now.


#4

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.