If I do this in one of my repositories:
git subtree pull --prefix=frameworks/AquaticPrime --squash AquaticPrime
I get this:
Working tree has modifications. Cannot add.
If I do this (in the same place, of course):
git status
I get this:
# On branch master
nothing to commit (working directory clean)
I'm not quite sure what's going on here. The git status command implies that I don't have modifications, so I'm assuming that the git subtree pull is referring to modifications in a different branch related to the subtree, but it's not entirely clear.
Can anyone provide enlightenment?
I just had the same problem.
From GIT source, error is thrown when command git diff-index HEAD
returns result, even if git status
says working tree is clean.
To avoid this error, in my case, I re-checkout the current branch of working tree , and everything seems OK : git checkout <branch>
It's a bit confused, but if someone can explain why ...