2013-03-13 95 views
2

我已經安裝了Gitolite,就像在Gitlab指示說,直到現在它是一切OK,回購的創造......但試圖克隆或推時,它返回NO回購發現 - 水木清華similiar,如何解決無效的回購名稱git錯誤?

但是當我在我的遠程設置爲如Git @服務器的完整路徑:22 /〜混帳/庫/ repo.git

它克隆,但是當試圖推動,它抓住了一個錯誤:

git push origin master 
ERROR: invalid repo name. 
fatal: The remote end hung up unexpectedly 

能有什麼它是?

+0

可能的重複http://stackoverflow.com/questions/11240797/git-commit-error-repository-invalid? – 2013-03-13 21:37:03

+0

沒有,= \,我已經看到了這一個...錯誤是diferent,反正謝謝 – 2013-03-14 17:07:19

回答

1

該錯誤消息來自 「gitolite-shell.parse_soc()

sub parse_soc { 
    my $soc = $ENV{SSH_ORIGINAL_COMMAND}; 
    $soc ||= 'info'; 

    my $git_commands = "git-upload-pack|git-receive-pack|git-upload-archive"; 
    if ($soc =~ m(^($git_commands) '/?(.*?)(?:\.git(\d)?)?'$)) { 
     my ($verb, $repo, $trace_level) = ($1, $2, $3); 
     $ENV{D} = $trace_level if $trace_level; 
     _die "invalid repo name: '$repo'" if $repo !~ $REPONAME_PATT; 
     trace(2, "git command", $soc); 
     return ($verb, $repo); 
    } 

隨着REPONAME_PATT之中:

$REPONAME_PATT = qr(^\@?[0-9a-zA-Z][-0-9a-zA-Z._\@/+]*$); 

一個gitolite地址不應包含任何路徑,像這樣:

[email protected]:22/repo 

而不是[email protected]:22/~git/repositories/repo.git,這個問題是described here

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.

相關問題