Gitflow: Plus sign in the feature branch name

Created on 24 Aug 2011  ·  6Comments  ·  Source: nvie/gitflow

I had a feature branch named 'feature/google+' and unfortunately none of the git flow command could find it. I got all the time:
_Branch 'feature/google+' does not exist and is required._

Problably some problem with grep or sth. Would be worthy to check also some other characters which are allowed in branch names but are not caught by git flow

Regards
Michal

All 6 comments

Git supports the + so it is specific to gitflow:

git branch 'google+'

Same issue. The "+" character doesn't work with gitflow.
git flow release start 1.0+1.1b1 works
git flow release finish 1.0+1.1b1 says Branch 'release/1.0+1.1b1' does not exist and is required.
I have to rename the branch to release/1.0_1.1b1, finish the release, create an other tag with the good name 1.0+1.1b1 and delete the other tag. A bit dispointed ;)

Thanks for your work !

Have the same problem here. This still doesn't seem to have been fixed. Using @pyby's workaround seems to work, but it's just a bit hacky.

Worth referring to this is if you wanna do it this way though:

Just stepped on the trap as well... Hopefully we can have this fixed soon, plus sign is a valid way to add build info to version number per semver spec.

:+1:

the following patch fixed things for me:

--- /usr/local/Cellar/git-flow/0.4.1/libexec/bin/gitflow-common.orig    2017-10-05 20:35:16.000000000 -0500
+++ /usr/local/Cellar/git-flow/0.4.1/libexec/bin/gitflow-common 2017-10-05 20:35:03.000000000 -0500
@@ -50,7 +50,15 @@ escape() {

 # set logic
 has() {
-       echo " $@ " | grep -q " $(escape $item) "
+       local item=$1; shift
+       for s in $@; do
+               if [ "$item" = "$s" ]; then
+                       return 0
+               fi
+       done
+       return 1
+        # the following code has issues with + in the branch names
+       #echo " $@ " | grep -q " $(escape $item) "
 }

 # basic math
Was this page helpful?
0 / 5 - 0 ratings