git forces refresh index after switching between windows and linux

后端 未结 2 2110
栀梦
栀梦 2021-02-05 17:37

I have a disk partition (format: NTFS) shared by windows and linux. It contains a git repository(about 6.7G).
If I only use windows or only use linu

2条回答
  •  抹茶落季
    2021-02-05 18:07

    As torek mentioned, you probably don't want to do this. It's not generally a good idea to share a repo between operating systems.

    However, it is possible, much like it's possible to share a repo between Windows and Windows Subsystem for Linux. You may want to try setting core.checkStat to minimal, and if that isn't sufficient, core.trustctime to false. That leads to the minimal amount of information being stored in the index, which means that the data is going to be as portable as possible.

    Note, however, that if your repository has symlinks, that it's likely that nothing you do is going to prevent refreshes. Linux typically considers the length of a symlink to be its length in bytes, and Windows considers it to take one or more disk blocks, so there will be a mismatch in size between the operating systems. This isn't avoidable, since size is one of the attributes used in the index that can't be disabled.

提交回复
热议问题