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

后端 未结 5 602
梦毁少年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 20:15

    Since git is case sensitive, but the OS is not, git thinks the path is wrong when it actually exists with different caps.

    A programmatic way to fix this can be deleting the conflicting path from the OS and then doing a git reset --hard HEAD or checkout the directory from the HEAD.

提交回复
热议问题