2013-03-08 55 views
1

/home/git/repositories dir中有一些git裸回購。
我使用git-daemon-run服務git協議來訪問這些回購。
例如/home/git/repositories/root/spider.git是一個純粹的git回購。爲什麼我可以使用git-daemon來服務我的git回購?

這是命令ps -ef | grep git的結果。

120  9638 1062 0 10:44 ?  00:00:00 /usr/local/libexec/git-core/git-daemon --verbose --reuseaddr --base-path=/home/git/repositories --export-all --max-connections=64 -- /home/git/repositories 

當我exec的git clone git://hostname/root/spider.git,我得到:

Cloning into 'spider'... 
fatal: remote error: access denied or repository not exported: /root/spider.git 

我檢查系統日誌/var/log/git-daemon/current,我得到:

2013-03-08_02:56:02.42145 [9698] Connection from 127.0.0.1:60080 
2013-03-08_02:56:02.42149 [9698] Extended attributes (22 bytes) exist <host=hostname> 
2013-03-08_02:56:02.42186 [9698] Request upload-pack for '/root/spider.git' 
2013-03-08_02:56:02.42189 [9698] '/home/git/repositories/root/spider.git' does not appear to be a git repository 
2013-03-08_02:56:02.42221 [9638] [9698] Disconnected (with error) 

回答

2

從錯誤信息,仔細檢查你的路徑,確保你做了一個

cd /home/git/repositories/root/ 
git init --bare spider 

如果回購已,而是直接在「/home/git/repositories」,那麼你就需要去適應你的git clone命令存在:

git clone git://hostname/spider.git 

最後,確保過程的git守護進程具有訪問權存儲庫

運行git-dameon的帳戶必須能夠訪問/home/git/repositories/root/sipder.git

+0

謝謝您的回答,但問題還沒有解決。我仔細檢查了路徑並修改了我的命令。 – 2013-03-08 11:57:22

+1

@王振威然後這是一個正確的問題?該進程是否有權訪問'/ home/git/repositories/root/sipder.git'?裸露的回購是爲root保護的嗎? – VonC 2013-03-08 12:05:04

+0

謝謝!共鳴是,該過程沒有權限訪問回購,我已經解決了! – 2013-03-09 02:00:05

1

在repo目錄中創建一個名爲git-daemon-export-ok的空文件。

+2

在提到的原始問題中,「--export-all」處理了這個問題。 – Kamiccolo 2014-10-29 22:12:18

1

--enable=receive-pack加到git daemon命令行中,啓用send-packmanual)支持。您將需要git reset --hard

相關問題