Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first
I had a different situation.
Background
The other answers are fine if you have never git flow initialized the specific repository you are working with, or you did, and want to re-apply that action to clear some buggy state by first clearing the relevant entries out of your .git/config
file.
I also use SourceTree, and noticed it was having this problem.
I found what I had done differently recently was cleared out my local master
branch that git flow must have ambiguously considered to be a git flow uninitialized repository, even through I had my usual configuration already present.
Solution
I re-checked out my master
branch, and git flow works again (to start a new feature, for example)!
You have to init the git flow on your local repo.
GitFlow are local scripts on your machine and each repository has to have teh metadata (in the config) to use it.
simply run :
# launch the git flow wizard
git flow init
# Use git flow with default values
git flow init -d
And you are set to go.
I got it working by doing the steps mentioned by jpfl @ answers.atlassian.com:
Although this is an old post, just wanted to add to this since I've gotten stuck on this same error. Was able to resolve by doing the following:
- Open the .git\config file OR Repository -> Repository Settings -> Remotes -> Edit Config File (Sourcetree 2.7.6)
- Remove all the [gitflow * entries and save the file
- Close and re-open SourceTree
- In the main menu, go to Repository > Git Flow > Initialise Repository (should be enabled now)