2011-02-18 182 views
6

我試圖建立gitolite我的服務器(MacOS的服務器)上。Gitolite混帳克隆錯誤

我跟着INSTALL文件中的說明在這裏找到: http://sitaramc.github.com/gitolite/doc/1-INSTALL.html

我安裝的根方法。

我得到的一切設置(SSH PUBKEY認證和默認設置gitolite)

$ssh [email protected] info 
hello admin, the gitolite version here is v1.5.9.1-27-gb97115f 
the gitolite config gives you the following access: 
    R W gitolite-admin 
    @R_ @W_ testing 

根據安裝說明我應該能夠簽出庫。

但是當我嘗試克隆gitolite管理員repositry我得到一個錯誤:


$ git clone [email protected]:gitolite-admin 
Cloning into gitolite-admin... 
Assertion failed: (argv0_path), function system_path, file exec_cmd.c, line 27. 
error: git-shell died of signal 6 
fatal: The remote end hung up unexpectedly 

我gitolite和git V的最新Git版本1.7.3.4

任何人可以幫助我?

編輯1:錯誤消息之前添加的git克隆命令

+0

什麼是您使用的git克隆命令? – VonC 2011-02-18 12:34:13

+0

git clone git @ server:gitolite-admin – skipper3k 2011-02-18 12:39:26

+0

我想嘗試像這樣的克隆:「git clone ssh:// git @ server/gitolie-admin」,但不知道這是否是問題的原因。 – 2011-02-18 12:45:26

回答

7

OP skipper3kreports一個與RUNTIME_PREFIX發行Git,有點類似於「git pull broken」的問題:

I'm not sure whether RUNTIME_PREFIX is defined for you. But while nosing in the Makefile , I did notice that prefix defaults to $(HOME) . I suspect that this may be the cause of your problems.

The simple answer is to put this in ~/.bashrc :

export GIT_EXEC_PATH=/opt/local/libexec/git-core 

If you want to find out more about what's going on, you'll probably have to recompile git using port -d upgrade -f git-core (or similar) and look closely at the build log to see where prefix is being set.
Incidentally, port cat git-core shows heavy usage of ${prefix} .


原來的答覆:

首先,你得到最先進的最新版本gitolite?
https://github.com/sitaramc/gitolite/,您需要考慮 'pu' 分支。

installation documentation is then this one


GitoliteV3 or 'g3' DOC:

"Installation" consists of the following options:

  1. Keep the sources anywhere and use the full path to run the gitolite command.
  2. Keep the sources anywhere and symlink just the gitolite program to some directory on your $PATH.
  3. Copy the sources somewhere and use that path to run the gitolite command.

You can run the 'install' command in 3 different ways:

# option 1 
gitolite/install 

# option 2 
gitolite/install -ln 
# defaults to $HOME/bin, or use a specific directory: 
gitolite/install -ln /usr/local/bin 

# option 3 
gitolite/install -to /usr/local/gitolite/bin 

老答案gitolite V2: 其次,我更喜歡from-client method方法:

The advantage of this method is that it forces you to solve the ssh pubkey problem before attempting to install.
It works best if you have dedicated userids,

  • one on the server for installing gitolite,
  • and one on the client for administering it.

The disadvantage is that the admin user ends up with two keys

  • one for shell access (that he started with) and
  • one for gitolite access (which the script creates if needed).

所以我喜歡營造一種~/.ssh/config文件用兩組不同的參數:

host gitolite 
    user git 
    hostname server 
    identityfile ~/.ssh/git 
host gitadmin 
    user git 
    hostname server 
    identityfile ~/.ssh/id_rsa (myaccount public key) 

gitolite管理員僅適用於首次公開SSH密鑰可見:

C:\HOMEWARE\git>ssh gitolite 
hello git, the gitolite version here is v1.5.9-25-ga10287a 
the gitolite config gives you the following access: 
    R W  gitolite-admin 
    @R_ @W_  testing 
Connection to server closed. 

用我的賬戶:

C:\HOMEWARE\git>ssh gitadmin 
hello myaccount, the gitolite version here is v1.5.9-25-ga10287a 
the gitolite config gives you the following access: 
    @R_ @W_  testing 
Connection to mccprdgit10 closed. 

所以:

C:\HOMEWARE\git>git clone gitolite:gitolite-admin 
Cloning into gitolite-admin... 
remote: Counting objects: 16, done. 
remote: Compressing objects: 100% (13/13), done. 
remote: Total 16 (delta 2), reused 0 (delta 0) 
Receiving objects: 100% (16/16), done. 
Resolving deltas: 100% (2/2), done. 
2

問題是在git編譯在Mac上的方式。我不得不手動編譯沒有RUNTIME_PREFIX集的git。現在它可以工作。

8

看來正確的修復這個錯誤是

$ENV{GIT_EXEC_PATH} = "/usr/libexec/git-core"; 

添加到您的.gitolite.rc文件。

0

剛剛處理了這個第三個忘記前兩次後,我認爲它不是不尋常的。

$ git clone [email protected]:gitolite-admin 
Cloning into gitolite-admin... 
fatal: The remote end hung up unexpectedly 

至少有一個原因是,gitolite用戶必須有一個登錄shell - 使系統用戶將不會因爲某些原因..它只是翻倒工作,導致上述錯誤。

此外,爲SSH測試,你必須關閉的pty在命令行上,否則SSH是行不通的 - 我想,也許這與舊版本的ssh的工作,但沒有任何東西我有:

$ ssh [email protected] 
PTY allocation request failed on channel 0 

$ ssh -T [email protected] 
hello key, this is [email protected] running gitolite3 v3.01-10-g699bafa on git 1.7.10 

(爲什麼它認爲我叫'鑰匙'是另一個配置問題,我還沒有解決)。

2

我幾乎嘗試過任何我能想到的,並不能得到它的工作...直到我注意到的地方,GIT是電子郵件地址非常高的,所以,我使用-c選項再生我的SSH密鑰對:

SSH-凱基-t RSA -C 「[email protected]

低,不料,突然間,我可以克隆gitolite管理員沒有任何問題的。

顯然在的.gitconfig的user.email關鍵的電子郵件必須符合到用於生成SSH密鑰的電子郵件。老實說,如果你的.ssh文件夾中只有一個密鑰對,那麼爲什麼這個電子郵件對應呢? Imho,如果您傳遞了一個密鑰,並且該密鑰位於服務器上的authorized_keys中,則無論.gitconfig user.email屬性如何,它都應該可以正常工作。