I want to finish a feature using git flow but I get a fatal error: fatal: Index contains uncommited changes. Aborting.
>git --version
git version 1.8.3.msysgit.0
>git flow feature list
* google-oauth
>git branch
develop
* feature/google-oauth
master
>git flow feature finish google-oauth
fatal: Index contains uncommited changes. Aborting.
>git status
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory.
# On branch feature/google-oauth
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: app.js
It looks like you need to commit your changes (if you want to keep them)... git flow feature finish
does not do this for you.
A simple: git commit -m "my commit message"
should do the trick.
If you don't want to keep the changes. You'll need to follow the instructions in the git status
message and
use "
git reset HEAD <file>...
" to unstage
git flow
message is self explanatory. It says
Fatal: Index contains uncommitted changes. Aborting.
It simply says you need to commit your changes before you finish the flow. So if you want to have those changes, just do
git add app.js
git commit -m "Finished app.js code for google-oauth feature" //Or some other apt message
Just in case you do not want to have those changes (Discard), you can use git stash
.
git stash
To get back your changes from stash, use
git stash apply
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