Is there a command to undo git flow init?

Git Flow

Git Flow Problem Overview


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 = 

Git Flow Solutions


Solution 1 - Git Flow

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

Solution 2 - Git Flow

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionpayliuView Question on Stackoverflow
Solution 1 - Git FlowdanidemiView Answer on Stackoverflow
Solution 2 - Git FlowPeter van der DoesView Answer on Stackoverflow