使用git时,Mac / Windows文件权限问题 [英] File permission issue with Mac/Windows when using git
问题描述
我运行以下代码从windows git仓库中提取文件。
git pull / Volumes / sucho / Desktop / git / setup
我按如下方式连接Windows目录。
告诉applicationFinder
使用密码PW将用户名USR装入卷cifs:// WINDOWS / c $ / Users / sucho
结束告诉
它运行良好,但问题是从Windows拉出的文件有700 (RWX ------)。如何将644(rw-r - r--)设置为默认值?
这不是真的回答您的原始问题,但我希望强调尝试尝试@ drewag提出的解决方案时遇到的另一个问题...
尝试忽略文件时遇到的另一个问题无论是在Windows还是Mac机器上(在Windows计算机上更偏重于!),都是全局性问题与项目级别配置问题。
运行这个命令没有影响我的 C:\Users\Username 文件夹中的.gitconfig文件:
git config core.filemode false
虽然添加 --global 标志确实会影响我正在寻找的更改:
git config --global core.filemode false
希望这可以帮助别人解决一些头痛的问题!
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?
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!
这篇关于使用git时,Mac / Windows文件权限问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!