linux – ‘git clone’尊重umask,顶级项目目录除外

linux – ‘git clone’尊重umask,顶级项目目录除外,第1张

概述我想克隆一个git项目(来自 github,比方说),并让顶级目录可以按组写入. 我试了几个不同的东西.首先,只需在克隆之前设置umask. $umask0002 然后,我创建的文件可以按组写入 $touch test$ls -l test-rw-rw-r-- 1 user group 0 2012-05-17 09:32 test 现在我尝试git clone $git clone git 我想克隆一个git项目(来自 github,比方说),并让顶级目录可以按组写入.

我试了几个不同的东西.首先,只需在克隆之前设置umask.

$umask0002

然后,我创建的文件可以按组写入

$touch test$ls -l test-rw-rw-r-- 1 user group 0 2012-05-17 09:32 test

现在我尝试git clone

$git clone [email protected]:user/repo.gitcloning into repo... [succeeds]

但是克隆目录不能由组写入.

$ls -ld repodrwxr-xr-x 11 user group 4096 2012-05-17 09:32 repo

我尝试使用git init –shared = umask(应该已经是默认值)在具有775权限的目录中创建的repo同样的事情.推送到github后,git clone获得了相同的结果.

这不是一个大问题,我可以在我的结帐脚本中chmod.但是如果有正确的/内置的方法来做到这一点,那就更好了. Git是Ubuntu 11.04上的1.7.4.1版本.

任何想法或链接都表示赞赏.我看到this post,but it uses chmod,我还没有找到其他的东西.谢谢!

解决方法 尝试仅为clone命令设置全局“core.sharedRepository = group”:
git -c "core.sharedRepository=group" clone [email protected]:user/repo.gitls -ld repo/.gitdrwxrwsr-x 8 user user 4096 Jul  4 22:16 repo/.git/
总结

以上是内存溢出为你收集整理的linux – ‘git clone’尊重umask,顶级项目目录除外全部内容,希望文章能够帮你解决linux – ‘git clone’尊重umask,顶级项目目录除外所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/1033025.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存