gitflow
gitflow copied to clipboard
`git flow init -d` fails if only the develop branch exists
Using this repo as an example, git flow init -d
will fail if the only branch that exists is "develop":
$ git clone git://github.com/nvie/gitflow.git
Cloning into gitflow...
remote: Counting objects: 1407, done.
remote: Compressing objects: 100% (598/598), done.
remote: Total 1407 (delta 891), reused 1291 (delta 794)
Receiving objects: 100% (1407/1407), 358.54 KiB | 188 KiB/s, done.
Resolving deltas: 100% (891/891), done.
$ cd gitflow/
$ git submodule init && git submodule update
Submodule 'shFlags' (git://github.com/nvie/shFlags.git) registered for path 'shFlags'
Cloning into shFlags...
remote: Counting objects: 454, done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 454 (delta 389), reused 453 (delta 388)
Receiving objects: 100% (454/454), 101.23 KiB, done.
Resolving deltas: 100% (389/389), done.
Submodule path 'shFlags': checked out '2fb06af13de884e9680f14a00c82e52a67c867f1'
$ sudo make install
[sudo] password for andy:
install -d -m 0755 /usr/local/bin
install -m 0755 git-flow /usr/local/bin
install -m 0644 git-flow-init git-flow-feature git-flow-hotfix git-flow-release git-flow-support git-flow-version gitflow-common gitflow-shFlags /usr/local/bin
$ git flow init -d
Using default branch names.
Which branch should be used for bringing forth production releases?
- develop
Branch name for production releases: []
Local branch '' does not exist.
$ git branch
* develop
PS. Apologies if this is a duplicate, I did find similar tickets but not this.
+1
+1
This happens because gitflow doesn't fetch all branches from the remote.
I believe gitflow should do that on startup, even without the -d
option. If the only local branch is develop
, the init
wizard won't help you at all.
+1
It would be great to have a pull request addressing/patch resolving this issue, or at least one for the ITM Gitflow fork.
The problem of @AD7six has been resolved in the gitflow AVH Edition
Fetching all branches from the remote before the init is a good addition and will be implemented soon on the dev version.
Thanks for the hint @petervanderdoes and your fix.
![screen shot 2018-08-06 at 5 00 54 pm](https://user-images.githubusercontent.com/9015517/43721006-4ea42772-999a-11e8-9da1-7e5df26ac8f3.png)
@petervanderdoes @fspreng
How did you solve it?
You need create master branch in remote and local repo then set 'Branch name for production releases:' to master.