我解決了類似的問題。這可能不是你的情況,但你可以嘗試重新應用我所做的相同的故障排除。
我意識到,當我在爲新用戶推送密鑰時,我得到了這個堆棧跟蹤,這是gitosis掛鉤無法處理新密鑰的症狀。
remote: Traceback (most recent call last):
remote: File "/usr/local/bin/gitosis-run-hook", line 9, in <module>
remote: load_entry_point('gitosis==0.2', 'console_scripts', 'gitosis-run-hook')()
remote: File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/app.py", line 24, in run
remote: return app.main()
remote: File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/app.py", line 38, in main
remote: self.handle_args(parser, cfg, options, args)
remote: File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/run_hook.py", line 81, in handle_args
remote: post_update(cfg, git_dir)
remote: File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/run_hook.py", line 45, in post_update
remote: config=cfg,
remote: File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/gitdaemon.py", line 95, in set_export_ok
remote: for (dirpath, repo, name) in walk_repos(config):
remote: File "/usr/local/lib/python2.7/dist-packages/gitosis-0.2-py2.7.egg/gitosis/gitdaemon.py", line 72, in walk_repos
remote: assert ext == '.git'
remote: AssertionError
的錯誤是隻顯示ONCE,所以我天真地駁回它作爲一個短暫的失敗。
實際上,Gitosis只能用於我的密鑰,但它不適用於我試圖支持的任何用戶。在~/.ssh/authorized_keys
我找不到我剛剛添加的用戶的公鑰。這就是爲什麼我的朋友每次嘗試克隆都被要求輸入密碼。
我添加調試Gitosis的設置,加入這兩行gitosis.conf
[gitosis]
loglevel=DEBUG
我必須繼續添加和刪除用戶gitosis.conf的文件,以便在吊鉤將再次觸發。我的調試日誌顯示
remote: DEBUG:gitosis.gitdaemon:Deny 'syncShare'
remote: DEBUG:gitosis.gitdaemon:Walking 'legacy.d', seeing ['buildtools', 'QA_Dashboard']
remote: DEBUG:gitosis.gitdaemon:Walking 'legacy.d/buildtools', seeing ['.git', 'conf', 'scripts']
remote: Traceback (most recent call last):
etc ...
A-ha!當鉤子通過存儲庫執行「漫遊」時,它發現了.git
目錄下的legacy.d/buildtools
,這正是assert ext == '.git'
發生的地方。
我曾經使用服務器來存儲來自其他存儲庫的簡單克隆。請注意,一個普通的克隆,而不是一個鏡像或裸存儲庫。像每個包含.git目錄的克隆一樣。
Gitosis中的掛鉤不知道如何處理.git目錄。它認爲它是一個空名稱的存儲庫並中止。一旦我消除了克隆,一切恢復正常。
或者只是重新啓動您的控制檯 – Reda 2013-04-11 23:44:19