I cloned a project and ran git checkout -b develop
. When I run git flow feature start feature_name
it gives me the following error:
Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first.
can any one help me?
I cloned a project and ran git checkout -b develop
. When I run git flow feature start feature_name
it gives me the following error:
Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first.
can any one help me?
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)
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 had a different situation.
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.
I re-checked out my master
branch, and git flow works again (to start a new feature, for example)!
If anybody run git flow init
and it doesn't work, an error like this:
git: 'flow' is not a git command. See 'git --help'.
Please follow these commands:
wget http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh –no-check-certificate
chmod +x gitflow-installer.sh
./gitflow-installer.sh
git flow init
I got it working by doing the steps on SourceTree:
Settings -> Advanced -> Edit Config File -> Remove all the gitflow * entries and save the file
and now you can set Initialise Repository.
There is a bug causing this in the version of git for windows I have installed, Git-2.17.1.2-64-bit.
Here is a fix for this outlined in an issue raised at https://github.com/petervanderdoes/gitflow-avh/issues/372
edit file C:\Program Files\Git\usr\bin\gitflow-common and add a ! just before $(git config --get-regexp gitflow.prefix >/dev/null 2>&1) ... ie change to this around line 297
gitflow_is_initialized() {
gitflow_has_master_configured && \
gitflow_has_develop_configured && \
[ "$(git config --get gitflow.branch.master)" != "$(git config --get gitflow.branch.develop)" ] && \
! $(git config --get-regexp gitflow.prefix >/dev/null 2>&1)}
Hopefully they fix this soon.
Update 2018/07/23
This just returned even with above fix. Looking at the PR to fix this, should actually remove the $() wrapped around the offending line:
git config --get-regexp gitflow.prefix >/dev/null 2>&1
You can remove gitflow.prefix
in <project_path>/.git/config
, and git flow init
again
If anybody runs git flow init
and it doesn't work resulting in an error like this, git flow
is simply not installed on your system.
git: 'flow' is not a git command. See 'git --help'.
Have a look at the GitFlow Wiki to find out how to install git flow. The most common way for Mac and Linux is listed below
brew install git-flow
apt-get install git-flow
Run
'git flow init'
and it will automatically initialize all the branches to the respective release branches like production release, next release, hotfix branches etc will be set. Here is a snapshot for that :
If you want to reinitialize these you can write: 'git flow init -f' this will force reinitialization.
If you're using SourceTree version 4.0 on MacOS (Sep 2019 is the last release at the time of this post) you may still run into the same error even after running the git flow init
command.
This can happen if you rename any branches (for example, devel instead of develop). It seems that something will error out in git flow, and will not recognise the renamed branches (you might also notice errors mentioning the default branches names instead of the renamed ones that you specified during initialization).
The solution in this case is:
git flow init -d
or git flow init
and then accepting all the default suggested valuesWhen you'll start Sourcetree again, you should now be able to use git flow normally.
fatal: Not a gitflow-enabled repo yet. Please run "git flow init" first.
Please follow below steps to remove this issue:
Open the .git\config file ( /!\ Show hiden items in your windows file explorer)
Remove all the [gitflow * entries and save the file
Close and (re-open SourceTree)
Go in the main menu, go to Repository > Git Flow > Initialise Repository (should be enabled now)
Or in the CLI type
git flow init
Hope this helps you !!!