Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git flow: fatal: Index contains uncommited changes. Aborting

Tags:

git

git-flow

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
like image 220
Sydney Avatar asked Feb 01 '14 14:02

Sydney


2 Answers

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

like image 176
Adam Wagner Avatar answered Sep 19 '22 20:09

Adam Wagner


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
like image 31
Sachin Avatar answered Sep 21 '22 20:09

Sachin