cygwin git认为该文件以前有不同的模式 [英] cygwin git thinks that file previously had different mode

查看:244
本文介绍了cygwin git认为该文件以前有不同的模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为cygwin手动构建了git的最新版本。唯一的问题是,它认为文件模式已更改(从644到755)。安装在Windows中的Git没有看到任何更改。实际文件模式是755(两个窗口Git和cygwin git显示相同)。

I manually built latest version of git for cygwin. The only problem is that it thinks that file mode changed (from 644 to 755). Git that is installed in windows doesn't see any changes. actual file mode is 755 (both windows Git and cygwin git shows the same).

所以,结果,
1)在windows git不显示任何更改, core.filemode 设置为true或false
2)在cygwin git显示模式的更改,如果 core.filemode 设置为true或未设置, core.filemode 设置为false时的任何更改
实际文件模式为755.

So, as a result, 1) on windows git doesn't show any changes whether core.filemode is set to true or false 2) on cygwin git shows changes for modes if core.filemode is set to true or unset and doesn't show any changes when core.filemode is set to false Actual file mode is 755.

我的问题是,在windows git(msysgit)中有一个bug(featue)模仿 core.filemode = false 忽略选项集。或者cygwin git显示错误先前的文件模式。我想它是第一个,因为文件是xml类型。

So, my question is, is there a bug(featue) in windows git (msysgit) that emulates core.filemode = false disregarding of option set. Or does cygwin git displays wrong previous file mode. I suppose it's the first, as files are of xml type.

推荐答案

mysysgit不支持文件权限。它假设所有的.exe是755和所有的文本是644.在我的经验,我总是有 filemode = false 在mysysgit的全局配置。

mysysgit doesn't support file permissions well. It assumes all .exe is 755 and all text is 644. In my experience, I always have filemode=false in the global config for mysysgit.

因为cygwin支持 chmod ,所以使用一个单独的全局配置为cygwin具有 filemode = true 你可以根据需要跟踪可执行的位,但是你必须从cygwin提交更改。

Using a separate global config for cygwin which has filemode=true since cygwin supports chmod and you can track the executable bit as needed, but you'd have to commit changes to it from cygwin.

我也注意到,当你克隆或初始化一个repo cygwin,它自动添加 core.filemode = true 到本地配置,它优先于全局,这将破坏我的建议。

I also noticed, when you clone or init a repo in cygwin, it automatically adds core.filemode=true to the local config, which has precedence over global, which will break my suggestion above.

我可以通过 git config --local -e 解决这个问题,删除 filemode

I was able to fix this by git config --local -e and deleting the filemode entry, leaving the global config as the only definition to use.

缺点是每个repo你克隆将它设置为 true ,所以你需要删除它的每个repo。我还没有找到一种方法来防止这种cygwin。

The downside is every repo you clone will have it set to true, so you'll need to delete it out of there per repo. I haven't found a way to prevent this on cygwin.

这篇关于cygwin git认为该文件以前有不同的模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆