The first workaround, which seems to work with recent versions of Git (2.3+, Q2+ 2015) is mentioned in grant’s more up-to-date answer:
-
Delete the index
$ rm .git/index
-
Add all
$ git add -A
-
Commit
$ git commit -a
Original answer (late 2014)
The usual workaround is to:
- clone again the remote repo into a new local repo
-
add the changes from the first repo to the second one:
$ cd /patH/to/second/cloned/repo $ git --work-tree=/path/to/first/repo add .
You can see this error message in read-cache.c
, discussed in this patch (“read-cache.c
: Ensure unmerged entries are removed “), and introduced in the Git 2.2 commit.
Since this is so recent, it is possible that downgrading Git to 2.1 would be enough to not be affected by that patch.
The OP Daniel Toebe adds in the comments:
The issue happened on my macbook, which decided to fail on me, and another computer mishap put me way behind on my projects.