git says “not under version control” for just-checked-out file

后端 未结 5 601
梦毁少年i
梦毁少年i 2021-02-08 19:37

I have the distinct impression my Git repo is somehow mangled.

Here\'s the sequence I\'m doing:

  1. git clone [remote\'s clone string]

    This creates,

5条回答
  •  臣服心动
    2021-02-08 19:55

    Maybe 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):

    Doing the 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 "app".
    When I checked out the repo under Windows, because of the case-insensitivity of Windows, it actually overlayed the two folders into one into "App".
    Which meant, the directory structure was fine, but half of the files (the ones coming from the "app" side) had an invalid Git path!

提交回复
热议问题