我正在尝试在 Ubuntu 中设置 Git 服务器,但无法解决这个问题。我正尝试将我的公钥添加到 Gitosis(到目前为止,每个教程都指示我这样做):
sudo -H -u git gitosis-init < /tmp/pcalves.pub
但不断收到相同的错误消息:
Reinitialized existing Git repository in /var/git/repositories/gitosis-admin.git/
Reinitialized existing Git repository in /var/git/repositories/gitosis-admin.git/
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.6/dist-packages/gitosis-0.2-py2.6.egg/gitosis/app.py", line 24, in run
return app.main()
File "/usr/local/lib/python2.6/dist-packages/gitosis-0.2-py2.6.egg/gitosis/app.py", line 38, in main
self.handle_args(parser, cfg, options, args)
File "/usr/local/lib/python2.6/dist-packages/gitosis-0.2-py2.6.egg/gitosis/init.py", line 140, in handle_args
run_hook.post_update(cfg=cfg, git_dir=admin_repository)
File "/usr/local/lib/python2.6/dist-packages/gitosis-0.2-py2.6.egg/gitosis/run_hook.py", line 43, in post_update
config=cfg,
File "/usr/local/lib/python2.6/dist-packages/gitosis-0.2-py2.6.egg/gitosis/gitdaemon.py", line 79, in set_export_ok
assert ext == '.git'
AssertionError
尽管前两行显示了预期的结果,但它似乎不起作用,因为之后,如果我尝试在本地机器上克隆存储库,我会得到以下信息:
fatal: 'gitosis-admin.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
答案1
老问题了,因此仅回答档案中的问题。
检查中的目录名称/var/git/repositories/
;确保所有 git 存储库都以 结尾.git
。