简体   繁体   中英

Use cygwin-git and git for windows in parallel

I'm using cygwin-git and git for Windows (actually used by TortoiseGit) in parallel. If I use them on the same repo, git status starts refreshing the index if I have used the other client before.

I compared the output of git ls-files --debug after running each client. The difference is in the file-stats. While the cygwin-client really saves the file stats:

  dev: -1177461325      ino: 227463
  uid: 1129333  gid: 1178613

the file stats in the index produced by git for Windows are all 0:

  dev: 0        ino: 0
  uid: 0        gid: 0

Can I stop git saving the files stats and thus preventing the refreshing of the index when switching clients?

There are a couple of Git options that you can try to see if they'll help. You can set core.checkstat to minimal , which ignores the uid, gid, device, and inode numbers, and optionally core.trustctime to false, which ignores the ctime. Based on the output you've given, you should try them in that order.

Do note that there are some other incompatibilities that you may run across that can prevent things from working out which are not as easily fixed. If you have symbolic links, those can be stored differently. Cygwin can either use native Windows symbolic links or not, and depending on whether it does (and how Cygwin stores the size if it does), you may find that git status still performs a refresh. This also happens with plain Windows and Windows Subsystem for Linux, and is not fixable there, either.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM