File permission issue with Mac/Windows when using git

余生长醉 提交于 2019-11-30 03:30:53

问题


I ran the following code to pull files from windows git repository.

git pull /Volumes/sucho/Desktop/git/setup

And I connect the Windows directory as follows.

tell application "Finder"
    mount volume "cifs://WINDOWS/c$/Users/sucho" as user name "USR" with password "PW"
end tell

It works well, but the problem is the pulled files from windows have 700 (rwx------). How can I set it 644(rw-r--r--) as default?


回答1:


This isn't really answering your original question, but I hope to highlight another issue I ran into when attempting to trying @drewag's proposed solution...

Another issue I ran into when attempting to ignore file permissions, regardless of whether it was on a Windows or Mac machine (more prevelant on the Windows machine!), was the problem global vs. project-level configurations.

Running this command did not affect the .gitconfig file in my C:\Users\Username folder:

 git config core.filemode false

Although adding the --global flag did affect the change I was looking for:

 git config --global core.filemode false

Hope this helps someone solve some of their headaches!




回答2:


If you don't care about file permissions, you can just tell your repository to ignore file permission:

git config core.filemode false


来源:https://stackoverflow.com/questions/3603476/file-permission-issue-with-mac-windows-when-using-git

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