运行gitosis-init时权限被拒绝

时间:2015-02-27 03:30:05

标签: git gitosis

我试图使用gitosis https://github.com/res0nat0r/gitosis 我将其作为README.md中的设置部分。

当我输入sudo -H -u git gitosis-init </.ssh/id_rsa.pub时,错误消息显示如下:

fatal: cannot copy '/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/templates/admin/hooks/post-update' to '/srv/pspms/git/repositories/gitosis-admin.git/hooks/post-update': Permission denied Traceback (most recent call last): File "/usr/local/bin/gitosis-init", line 9, in <module> load_entry_point('gitosis==0.2', 'console_scripts', 'gitosis-init')() File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/app.py", line 24, in run return app.main() File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/app.py", line 38, in main self.handle_args(parser, cfg, options, args) File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/init.py", line 138, in handle_args user=user, File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/init.py", line 75, in init_admin_repository template=resource_filename('gitosis.templates', 'admin') File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/repository.py", line 66, in init raise GitInitError('exit status %d' % returncode) gitosis.repository.GitInitError: exit status 128

似乎我没有将文件复制到git HOME目录?但我使用命令sudo

1 个答案:

答案 0 :(得分:0)

您的用户git无法访问以下日志输出中的某个目录:

fatal: cannot copy '/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/templates/admin/hooks/post-update' to '/srv/pspms/git/repositories/gitosis-admin.git/hooks/post-update': Permission denied

运行ls -la /srv/pspms/git/repositories/gitosis-admin.git并确保您的git用户可以访问该目录,/srv/pspms/git/repositories/gitosis-admin.git也是如此。