git subtree pull says that the working tree has modifications, but git status says it doesn't. What gives? git subtree pull says that the working tree has modifications, but git status says it doesn't. What gives? git git

git subtree pull says that the working tree has modifications, but git status says it doesn't. What gives?


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


git reset --hard fixed it to me

From git reset --help

--hard Resets the index and working tree. Any changes to tracked files in the working tree since are discarded.


I got around this now. My problem seemed to me that the repository was brand new: I had never committed anything to it. Once I committed a file to the repo, I was able to move past this error.

However, using the command git subtree add C:\gitTest\repos\subA -d --prefix subA I got the new error:

fatal just how do you expect me to merge 0 trees?

After messing around for a minute, I figured out it requires that a specific revision be passed to it. So this command seems to have succeeded:

git subtree add C:\gitTest\repos\subA HEAD -d --prefix subA

And obviously you don't need the -d debug flag.