I already have an existing repository with a couple of branches. Right now I have to initialize git flow here, using the source tree. But when I click on "git flow" button, and it tries to initialize the git flow, I get the following error:
sh.exe C:\Users\Foo\AppData\Local\Atlassian\SourceTree\gitflow_local\gitflow\git-flow init -d
fatal: Working tree contains unstaged changes. Aborting.
Completed with errors, see above.
I used git pull and git push on every branch, no uncommited changes...What's wrong?
Also, won't using git flow command on existing repo delete any files?
You have unstaged changes. Which are changes on files that are tracked by git, but not commited or added, thus they are not staged. If you don't care about these changes you can use:
git reset --hard
To get back to you HEAD's state.
If you do care about these changes, you should add/commit them before you run your command. (You can see these changes with git diff
).
AS I think you need to commit your changes.
git commit -m "my commit message
You should code this.
If you don't want to keep your changes. You need to follow the instructions in the git status message and
use git reset HEAD <file>...
Run git flow init from the repository folder just like as you would do for new repository
Source: FAQ · nvie/gitflow Wiki
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With