Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Initializing git flow in existing repository

Tags:

git

github

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?

like image 282
khernik Avatar asked Jan 31 '15 12:01

khernik


3 Answers

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).

like image 86
npmiller Avatar answered Oct 18 '22 02:10

npmiller


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>...

like image 32
gayan_ms Avatar answered Oct 18 '22 01:10

gayan_ms


Run git flow init from the repository folder just like as you would do for new repository

Source: FAQ · nvie/gitflow Wiki

like image 1
Porcupine Avatar answered Oct 18 '22 02:10

Porcupine