gitflow icon indicating copy to clipboard operation
gitflow copied to clipboard

`git flow init -d` fails if only the develop branch exists

Open AD7six opened this issue 11 years ago • 9 comments

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.

AD7six avatar Feb 20 '13 14:02 AD7six

+1

gunta avatar Aug 05 '14 06:08 gunta

+1

mdomke avatar Aug 26 '14 22:08 mdomke

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.

dandv avatar Nov 14 '14 01:11 dandv

+1

tahb avatar Jan 07 '15 12:01 tahb

It would be great to have a pull request addressing/patch resolving this issue, or at least one for the ITM Gitflow fork.

fspreng avatar Jan 13 '15 16:01 fspreng

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.

petervanderdoes avatar Jan 13 '15 23:01 petervanderdoes

Thanks for the hint @petervanderdoes and your fix.

fspreng avatar Jan 14 '15 09:01 fspreng

screen shot 2018-08-06 at 5 00 54 pm

@petervanderdoes @fspreng

How did you solve it?

alfredrumss avatar Aug 06 '18 14:08 alfredrumss

You need create master branch in remote and local repo then set 'Branch name for production releases:' to master.

salespaulo avatar Apr 29 '20 17:04 salespaulo