文件模式与msysgit [英] File mode with msysgit

查看:183
本文介绍了文件模式与msysgit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用msysgit(v1.7.7)在网络驱动器上从Windows克隆了一个Git存储库。
某些文件在资源库中被标记为具有模式100755。

使用Windows中的git bash工具, ls -l 命令有效地显示这些文件的良好权限。
现在,当我从Linux访问版本库目录时,这些文件有644个权限,而不是755个。



如果我在Linux端将它们改为755,回到Windows上的git bash工具:


  • ls -l <​​/ code>命令仍然显示文件具有755个权限

  • ,但 git diff 命令将文件更改模式从100755更改为100644



  • $ b

    任何想法如何在Windows上使用msysgit正确处理文件模式?



    我发现这个问题在msysgit上对应我的问题 http://code.google.com/ p / msysgit / issues / detail?id = 164
    我在我的文件中尝试了提示 git update-index --chmod = + x 但它没有改变任何东西。

    解决方案

    mingw不支持linux的文件模式。据我了解,它遵循Windows的扩展支持,即 .exe 将有+ x位。但是,chmod不会做任何事情。

    因此,对于git,您应该指定 git config core.filemode false 来禁用mingw中的文件模式支持。如果你需要改变它,你应该在Linux下完成。

    Howerver,也许我错了,但afair cygwin确实支持文件模式。你可以试试它,而不是mingw。


    I cloned a Git repository from Windows using msysgit (v1.7.7) on a network drive. Some files are marked on the repository to have mode 100755.

    Using the git bash tool from Windows, the ls -l command effectively shows the good permissions for those file. Now when I access the repository directory from Linux, those files have 644 permissions instead of 755.

    If I chmod them to 755 on the Linux side and go back to the git bash tool on Windows:

    • the ls -l command still shows the files to have 755 permissions
    • but the git diff command tells the files changed mode from 100755 to 100644

    Any idea how to properly handle file mode using msysgit on Windows?

    I found this issue on msysgit which corresponds to my problem http://code.google.com/p/msysgit/issues/detail?id=164 I tried the proposed hint git update-index --chmod=+x on my files but it did not change anything.

    解决方案

    mingw doesn't support file modes as linux does. As I understand it follows windows-extension support, i.e. .exe will have +x bits. But chmod doesn't do anything.

    So, for git you should specify git config core.filemode false to disable file mode support in mingw. And if you need to change it, you should do it under Linux.

    Howerver, maybe I'm wrong, but afair cygwin does support file modes. You could try it instead of mingw.

    这篇关于文件模式与msysgit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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