110

After git flow init, how to remove the git flow model?
How do I remove all related config from the .git/config file?

$ git flow init
# force reset
$ git flow init -f

How to remove below content from the .git/config file?

[gitflow "branch"]
    master = master
    develop = develop
[gitflow "prefix"]
    feature = feature/
    release = release/
    hotfix = hotfix/
    support = support/
    versiontag = 
Dario Seidl
  • 4,140
  • 1
  • 39
  • 55
payliu
  • 2,410
  • 3
  • 18
  • 12
  • Posible duplicate thread http://stackoverflow.com/questions/3212459/is-there-a-command-to-undo-git-init – codebreaker Aug 28 '13 at 06:38
  • 4
    @codebreaker, thanks for reply. That thread [#3212459](http://stackoverflow.com/questions/3212459/is-there-a-command-to-undo-git-init) is about `git int`, not `git flow init`... – payliu Aug 28 '13 at 07:22

2 Answers2

156

You can do what @Peter said from the command line too!

Those commands remove all the sections of the git config file related to gitflow.

git config --remove-section "gitflow.path"
git config --remove-section "gitflow.prefix"
git config --remove-section "gitflow.branch"

Then you can re-init gitflow as usual.

git flow init
danidemi
  • 4,404
  • 4
  • 34
  • 40
40

If you removed those sections from your config any reference to git-flow is gone.

There isn't really a need to remove anything though, the git-flow model is just that, it's a model. You can always use standard git commands.

What git-flow adds to your config, only git-flow software will use, not the git itself.

Peter van der Does
  • 14,018
  • 4
  • 38
  • 42
  • 4
    I think the problem @payliu was running into is that when you run `git flow init` the values you set can't be reset by running `git flow init` a second time. The git flow tools make assumptions about your repo that might not be true when you run `git flow init`. See the issues developers are running into here: https://github.com/nvie/gitflow/issues/121 – ThomasW Mar 05 '15 at 07:08