Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File mode with msysgit

Tags:

git

msysgit

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.

like image 826
greydet Avatar asked Aug 30 '12 08:08

greydet


1 Answers

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.

like image 58
kan Avatar answered Oct 22 '22 02:10

kan