git ls-tree HEAD returns nothing and git mv returns not under version control

317 Views Asked by At

I am using GIT under windows with the GIT Bash tool and was trying to move a file from one directory to the another. I tried different methods like clean, commit again etc. but everytime I got a reply while using git mv that the said file is not under version control. However, git status -u shows that everything is OK. After trying a lot I found the answer which I am going to answer myself.

1

There are 1 best solutions below

0
On

I found out that the reason was a uppercase in the directory name. Well, GIT under Windows does not detect the difference in the case when looking for changed files through git status -u. The file which I wanted to move was in a directory whose name was ABCD, but the commited version was abcd. I dont know how the directory name changed to uppercase, but thats not the point here. If you have such a constellation where the commmitted version differs from the checkout version with respect to the case of the directory name, git status -u will never complain.