File mode with msysgit

佐手、 提交于 2019-12-07 02:35:36

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/12193020/file-mode-with-msysgit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!