git says “not under version control” for just-checked-out file
I have the distinct impression my Git repo is somehow mangled.
Here’s the sequence I’m doing:
git clone [remote’s clone string]
This creates, among many others, a file “App/android/AndroidManifest.xml”
git mv App/android/AndroidManifest.xml App/android/AndroidManifestTemplate.xml
This gives the error message “fatal: not under version control, source=App/And…”
Initially I thought this might be a gitignore thing, but that’s not it either. I tried git fsck, it doesn’t report anything.
Any suggestions on how to repair it?
One Solution collect form web for “git says “not under version control” for just-checked-out file”
App/android/AndroidManifest.xml does exist, but with a diferent case (like
App/android/androidmanifest.xml, which would mean that
App/android/AndroidManifest.xml isn’t versioned (hence the error message):
git mv with the right case should then be enough.
The OP explains in the comments:
What happened was that there were two folders in Git, “
App” and “
When I checked out the repo under Windows, because of the case-insensitivity of Windows, it actually overlayed the two folders into one into “
Which meant, the directory structure was fine, but half of the files (the ones coming from the “
app” side) had an invalid Git path!