故事是这样的……
我的团队在 Windows 文件服务器上有一个 git 存储库。 Windows 人员设置存储库并开始提交。我,一个 mac 人,克隆到我的文件系统,进行一些提交,然后推回(实际上我去 repo 并 pull 入我的更改)。现在的问题是我拥有对 repo 中文件的权限,即使我对我将 repo 克隆到的文件夹中的每个人都有读/写权限, repo 以某种方式对 Windows 操作系统施加了额外的权限限制,而我的同事不能提交。
这个场景也可以以另一种方式进行。我设置了存储库,一个 Windows 人员搞砸了权限。
那么你们如何确保不同开发环境之间的权限一致?
最佳答案
也许你可以尝试配置core.sharedRepository
:
core.sharedRepository
When group (or true), the repository is made shareable between several users in a group (making sure all the files and objects are group-writable).
- When all (or world or everybody), the repository will be readable by all users, additionally to being group-shareable.
- When
umask
(or false), git will use permissions reported byumask
(2).- When
0xxx
, where0xxx
is an octal number, files in the repository will have this mode value.0xxx
will override user’sumask
value (whereas the other options will only override requested parts of the user’s umask value).
Examples:0660
will make the repo read/write-able for the owner and group, but inaccessible to others (equivalent to group unlessumask
is e.g.0022
).
0640
is a repository that is group-readable but not group-writable. See git-init(1).False by default.
关于windows - 管理 windows 和 mac git 提交者之间的权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6841034/