2012-01-09 155 views
1

我處於一種情況,我有一個從git存儲庫克隆的本地源代碼樹,我嘗試推送到新的遠程位置。Gitolite:無法推送到存儲庫

我使用軟件包方法(deb)在服務器上安裝了gitolite。我跟着Wiki instructions,以成功git clone [email protected]:gitolite-admin結束。然後我添加了新的存儲庫和我的公鑰。我可以在我的機器上(客戶端)克隆這個存儲庫,但我無法推進它。該SSH troubleshooting document描述my scenario貼切:

consider [email protected]:repositories/reponame.git. The clone operation will work -- you're using the full Unix path, (assuming default $REPO_BASE setting), and so the shell finds the repo where you said it would be. However, when you push, gitolite's update hook kicks in, and fails to run because some of the environment variables it is expecting are not present

所以,我可以

git clone [email protected]:repositories/reponame.git

但不能克隆與

git clone [email protected]:reponame.git(我得到fatal: 'reponame.git' does not appear to be a git repository

如果我更改克隆(空)存儲庫並嘗試推送,我得到

remote: ENV GL_RC not set remote: BEGIN failed--compilation aborted at hooks/update line 20. remote: error: hook declined to update refs/heads/master

所以,這似乎與預固定 - 但是,正如我所說,我不能沒有包括在路徑中repositories/符克隆回購。

這是什麼意思是「繞過gitolite」?我該如何糾正這種情況?最終,我想將整個預先存在的源代碼樹推送到新的遠程服務器(我已將該新服務器作爲遠程服務器添加到.git/config中),並保留歷史記錄。

回答

0

我建議使用客戶端方法安裝gitolite。對我來說,它處理了這個確切的問題。

+0

我這樣做,但我陷入了相同的情況。 – appas 2012-01-10 16:47:05

+0

嗯。你在IRC的#git頻道上聯繫過Sitaram嗎?他和其他所有人一樣,對他非常有幫助。 – 2012-01-10 19:32:19

0

git clone [email protected]:reponame.git (I get fatal: 'reponame.git' does not appear to be a git repository)

reponame.git的路徑不正確。 您應該添加前綴庫/

git clone [email protected]:repositories/reponame.git 

意味着reponame.git是定位在/home/gitolite/repositories/reponame.git。