Open silasfn opened 6 years ago
I'm also getting that error on Windows using both Git Bash, Cmder or Powershell.
$ git flow version
1.11.0 (AVH Edition)
It's happening for both cloned and newly creates repos.
Is there any command line option to activate a verbose mode which would provide more info?
Thanks to a tip from Johannes in the related git for windows project. I was able to debug using the set -x
flag.
To debug git flow, see C:\Program Files\Git\usr\bin\git-flow
DEBUG="yes"
in command line, orset -x
at the beginning of the file.To fix the "not gitflow-enabled repo" bug, 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)
}
My limited tests seem to work - git flow feature start test succeeded after that change, and returned an error after I removed the "gitflow.prefix" lines from my .git/config file (expected behaviour).
I'll create a pull request, but the change might end up in a new fork that Johannes is creating. See: https://github.com/git-for-windows/git/issues/1720#issuecomment-397799721
Still get the error when finishing a release branch though. If you remove the fix release can be finished again.
@silasfn What's the output of git config --get-regexp gitflow.prefix
$ git config --get-regexp gitflow.prefix
gitflow.prefix.feature feature/
gitflow.prefix.bugfix bugfix/
gitflow.prefix.release release/
gitflow.prefix.hotfix hotfix/
gitflow.prefix.support support/
gitflow.prefix.versiontag
... and I updated the PR based on a tip from Johannes.
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
}
Removing the $( ... )
from the last part of the statement seemed to resolve all issues.
https://github.com/petervanderdoes/gitflow-avh/pull/374/files
For future reference, I was also having this issue but it was a matter of updating my git version Previous version git version 2.18.X.windows.1 Did NOT work!
Updated version git version 2.19.1.windows.1 Works!
I faced with the same problem:
$ git flow init -d
Using default branch names.
$ git flow feature start 123
Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first.
Environment information:
$ uname -a
Linux or-dsktp-arch 4.20.8-arch1-1-ARCH #1 SMP PREEMPT Wed Feb 13 00:06:58 UTC 2019 x86_64 GNU/Linux
$ git flow version
1.12.0 (AVH Edition)
$ git --version
git version 2.20.1
$ git config --get-regexp gitflow.prefix
gitflow.prefix.feature feature/
gitflow.prefix.release
gitflow.prefix.hotfix
gitflow.prefix.support
gitflow.prefix.versiontag
gitflow.prefix.bugfix
I got the reason of error in my case. I am confused about status of current issue and I doubt that my case is related to it. So I made another issue: #402
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 !!!
I just ran into this and it seemed to be because the production
branch was not a local branch.
Example fix:
$ git config --get-regexp gitflow.branch.master
gitflow.branch.master production
$ git flow bugfix start 3000
Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first.
$ git checkout production
branch 'production' set up to track 'origin/production'.
Switched to a new branch 'production'
$ git flow bugfix start 3000
Switched to a new branch 'bugfix/hexmode/3000'
Summary of actions:
- A new branch 'bugfix/hexmode/3000' was created, based on 'master'
- You are now on branch 'bugfix/hexmode/3000'
Now, start committing on your bugfix. When done, use:
git flow bugfix finish 3000
Setup
No
Details
Bash, on MINGW64
What did you expect to occur after running these commands? After running git flow init, I expected git flow feature start to create a feature branch
What actually happened instead? I got this error message: Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first.
If the problem was occurring with a specific repository, can you provide the URL to that repository to help us with testing?
Seems to occur on any git repository I have cloned, including git clone --recursive git://github.com/petervanderdoes/gitflow.git