Git sharedRepository的权限问题 [英] Permission problems with Git sharedRepository
问题描述
我正在使用Gitolite来管理我的git存储库。我还使用第三方Web应用程序来显示存储库。不过每次我做一个 git push --all git@myserver.com:myproject
第三方Web应用程序无法访问存储库文件。因此,我需要每次运行 chmod go + rx -R / path / to / the repository / folder
以查看存储库。
我已经设置了 git config core.sharedRepository all
但仍然不记得 git push
。
我该如何解决这个问题?
可以为你的gitolite环境定义一个钩子,以便更新一个非裸POS(与正确的ACL)从您的裸露回购管理的gitolite。
只要你不使用 rel =nofollow> update
一个 post-receive
挂钩,您可以在其中执行这些任务。
也就是说, a href =http://sitaramc.github.com/gitolite/rc.html =nofollow>变量 <$ c $ g> REPO_UMASK UMASK
与您的gitolite.rc有任何关系:
$ UMASK
,八进制,默认0077
gitolite使用的默认
UMASK
使所有repos及其内容具有rwx ------
权限。
想要运行gitweb
的用户会意识到这是不行的。
处理这个问题的正确方法是将此变量更改为0027(它可以让您rwxr-x ---
),然后添加运行webserver的apache或httpd用户作为'gitolite'组的成员。
请注意语法;领先的0是必需的。如果您在安装完成后更改它,您还必须执行一些
chmod
来调整已创建的文件和目录的权限。
(注意: REPO_MASK
得到 UMASK
与 GitoliteV3或'g3')
I am using Gitolite to manage my git repositories. And I also use a third-party web application to display the repositories.
However each time I do a git push --all git@myserver.com:myproject
the third-party web application can not have access to the repository files. So I need to run each time chmod go+rx -R /path/to/the/repository/folder
to see the repository.
I have set git config core.sharedRepository all
but still is not remembering the permissions after git push
.
How can I solve this problem?
You could define a hook to your gitolite environment in order to update a non-bare pos (with the right ACL) from your bare repo managed by gitolite.
As long as you don't use the update
hook (in Gitolite V3), you can define an post-receive
hook in which you would do those tasks.
That being said, check also if the variable REPO_UMASK
UMASK
in your gitolite.rc has any bearing on this issue:
$UMASK
, octal, default 0077The default
UMASK
that gitolite uses makes all the repos and their contents haverwx------
permissions.
People who want to rungitweb
realise that this will not do.
The correct way to deal with this is to change this variable to 0027 (which gets yourwxr-x---
), then add the apache or httpd user running the webserver as a member of the 'gitolite' group.Please note the syntax; the leading 0 is required. If you change it after the install is complete, you'll have to do some
chmod
's also to adjust permissions of files and directories that have already been created.
(Note: REPO_MASK
got UMASK
with GitoliteV3 or 'g3')
这篇关于Git sharedRepository的权限问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!