Domanda

I am using Sourcetree to work with my git repo on Bitbucket. I would like it so that when I initialize gitflow for the repository, everyone using Sourcetree doesn't also have to initialize gitflow. However, whenever someone clones the repo (or I delete and re-clone), I have to reinitialize gitflow. How do I get this to stick for everyone?

If I do this with a Mercurial repository, it works fine. Initialize HgFlow once, push, and everyone gets the settings.

È stato utile?

Soluzione

git flow stores the settings in the config file in the .git folder. This file isn't committed to source control. Therefore you must git flow init on each clone. Because of this I tend to not deviate from the proposed branch names ... since someone is bound to forget as they clone something and screw it up. :D

Could you store the settings elsewhere? A few thoughts come to mind:

  1. Rewrite git flow to store the settings inside a .gitflowconfig or similar -- good luck with that.

  2. Put the gitflow settings inside the global config at ~/.gitconfig. It's not "once and done" but it is "once per user".

  3. Because git flow is just a naming convention for branches, you need not "setup" git flow to use it, you just need to perform the steps it does. (e.g. git flow release finish merges to master and to develop.)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top