Gitolite git 克隆错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5041067/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 05:04:30  来源:igfitidea点击:

Gitolite git clone error

gitgitolite

提问by skipper3k

I am trying to setup gitolite on my server (Macos server).

我正在尝试在我的服务器(Macos 服务器)上设置 gitolite。

I followed the instructions in the INSTALL document found here : http://sitaramc.github.com/gitolite/doc/1-INSTALL.html

我按照此处找到的安装文档中的说明进行操作:http: //sitaramc.github.com/gitolite/doc/1-INSTALL.html

I installed the root method.

我安装了root方法。

I got everything setup (ssh pubkey authentication and default gitolite setup)

我完成了所有设置(ssh 公钥身份验证和默认 gitolite 设置)

$ssh git@server 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

According to installation instruction I should be able to checkout a repository.

根据安装说明,我应该能够检出存储库。

But when I try to clone the gitolite-admin repositry I get an error:

但是当我尝试克隆 gitolite-admin 存储库时,出现错误:


$ git clone git@server: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

I got the latest git version of gitolite and git v. 1.7.3.4

我得到了最新的 git 版本的 gitolite 和 git v. 1.7.3.4

Can anybody help me?

有谁能够帮助我?

Edit 1: added git clone command before error message

编辑 1:在错误消息前添加 git clone 命令

回答by Thomas Deniau

It seems the correct fix to this error is to add

似乎解决此错误的正确方法是添加

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

to your .gitolite.rc file.

到您的 .gitolite.rc 文件。

回答by VonC

The OP skipper3kreportsan issue with RUNTIME_PREFIXin Git, a bit similar to "git pullbroken" question:

OP skipper3k报告有问题,RUNTIME_PREFIX在Git中,有点类似“git pull”的问题:

I'm not sure whether RUNTIME_PREFIXis 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:

我不确定是否RUNTIME_PREFIX为您定义。但是在探索 . 时Makefile,我确实注意到前缀默认为$(HOME). 我怀疑这可能是导致您出现问题的原因。

简单的答案是把它放在~/.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-coreshows heavy usage of ${prefix}.

如果您想了解有关发生了什么的更多信息,您可能需要使用port -d upgrade -f git-core(或类似方式)重新编译 git并仔细查看构建日志以查看前缀的设置位置。
顺便说一下,port cat git-core显示了大量使用${prefix}.



Original answer:

原答案:

First, did you get the most up-to-date gitolite version?
At https://github.com/sitaramc/gitolite/, you need to consider the 'pu' branch.

首先,您是否获得了最新的 gitolite 版本?
https://github.com/sitaramc/gitolite/,您需要考虑 ' pu' 分支。

The installation documentation is then this one.

安装文档是那么这一个



GitoliteV3 or 'g3'doc:

GitoliteV3 或“g3”文档:

"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:

“安装”包含以下选项:

  1. 将源文件保留在任何位置并使用完整路径运行 gitolite 命令。
  2. 将源代码保存在任何地方,并将 gitolite 程序符号链接到 $PATH 上的某个目录。
  3. 将源文件复制到某处并使用该路径运行 gitolite 命令。

您可以通过 3 种不同的方式运行“安装”命令:

# 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


Old answer for gitolite V2: Second, I prefer the "from-client method"method:

gitolite V2 的旧答案:其次,我更喜欢 从客户端方法方法:

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 pubkey 问题。
如果你有专门的用户名,效果最好,

  • 服务器上的一个用于安装 gitolite,
  • 一个在客户端上用于管理它。

缺点是admin用户最后有两个key

  • 一个用于外壳访问(他开始使用)和
  • 一个用于 gitolite 访问(如果需要,脚本会创建)。

So I like to create a ~/.ssh/configfile with the two different sets of parameters:

所以我喜欢~/.ssh/config用两组不同的参数创建一个文件:

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

The gitolite-adminis only visible for the first public ssh 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.

With my account:

用我的账户:

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.

So:

所以:

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.

回答by skipper3k

The problem was with the way git was compiled on mac. I had to manually compile git without the RUNTIME_PREFIX set. Now it works.

问题在于 git 在 mac 上的编译方式。我不得不在没有设置 RUNTIME_PREFIX 的情况下手动编译 git。现在它起作用了。

回答by user1396544

I pretty much tried anything I could think of and couldn't get it to work...until I noticed somewhere that GIT is very high on email addresses...so I regenerated my ssh keypair using the -C option:

我几乎尝试了任何我能想到的东西,但无法让它工作……直到我注意到某个地方 GIT 的电子邮件地址非常高……所以我使用 -C 选项重新生成了我的 ssh 密钥对:

ssh-keygen -t rsa -C "[email protected]"

ssh-keygen -t rsa -C " [email protected]"

Low and behold, all of a sudden I could clone gitolite-admin without any problem.

瞧,突然间我可以毫无问题地克隆 gitolite-admin。

Apparently the email in .gitconfig's user.emailkey MUST correspondto the email that was used to generate the SSH key. Honestly, if you only have 1 keypair in your .ssh folder, why on earth does it matter that the email corresponds? Imho, if you pass a key and the key is in the authorized_keys on the server, it should work regardless of the .gitconfig user.email property.

显然 .gitconfig 的user.email密钥中的电子邮件必须与用于生成 SSH 密钥的电子邮件相对应。老实说,如果您的 .ssh 文件夹中只有 1 个密钥对,那么电子邮件对应到底为什么重要?恕我直言,如果您传递一个密钥并且该密钥在服务器上的 authorized_keys 中,则无论 .gitconfig user.email 属性如何,它都应该可以工作。

回答by Wilhelm

To pile on, as a solution for Gitolite v3, for Mac Lion, this is what worked for me:

作为 Gitolite v3 的解决方案,对于 Mac Lion,这对我有用:

$ENV{PATH}="/usr/local/bin:$ENV{PATH}";

$ENV{PATH}="/usr/local/bin:$ENV{PATH}";

Add it to ~/.gitolite.rcfor the git user on the server. Make sure it is before the "1;" at the end.

将它添加到~/.gitolite.rc以供服务器上的 git 用户使用。确保它在“1;”之前 在末尾。

As detailed in: https://serverfault.com/questions/307493/cant-clone-gitolite-admin

详见:https: //serverfault.com/questions/307493/cant-clone-gitolite-admin

The solutions involving GIT_PATH are outdated, according to: http://sitaramc.github.com/gitolite/g2migr.html

涉及 GIT_PATH 的解决方案已经过时,根据:http://sitaramc.github.com/gitolite/g2migr.html

回答by Tony Hoyle

Having just dealt with this for a thirdtime after forgetting the first two times, I figure it can't be unusual.

在忘记前两次之后刚刚第三次处理这个问题,我认为这不会不寻常。

$ git clone git@hugo:gitolite-admin
Cloning into gitolite-admin...
fatal: The remote end hung up unexpectedly

At least one reason for this is that the gitolite user musthave a login shell - making a system user won't work for some reason.. it just falls over, causing the error above.

至少有一个原因是 gitolite 用户必须有一个登录 shell - 使系统用户由于某种原因无法工作......它只是摔倒,导致上述错误。

Also, for the ssh test, you mustswitch off PTYs on the command line otherwise ssh simply won't work - I think maybe it worked with older versions of ssh but doesn't on anything I have:

此外,对于 ssh 测试,您必须在命令行上关闭 PTY,否则 ssh 根本无法工作 - 我认为它可能适用于旧版本的 ssh,但不适用于我拥有的任何东西:

$ ssh git@hugo
PTY allocation request failed on channel 0

$ ssh -T git@hugo
hello key, this is git@hugo running gitolite3 v3.01-10-g699bafa on git 1.7.10

(why it thinks I'm called 'key' is another config issue I haven't solved yet).

(为什么它认为我被称为“关键”是另一个我尚未解决的配置问题)。

回答by Claudio Acciaresi

don't know exactly which is the problem with your installation, it would be useful to know which commands you 've executed to install gitolite in your your server.

不知道您的安装到底是哪个问题,知道您执行了哪些命令来在您的服务器中安装 gitolite 会很有用。

I recommend you to read these two links, they were helpful for me when I installed gitolite:

我建议您阅读这两个链接,它们在我安装 gitolite 时对我很有帮助:

http://kris.me.uk/2010/09/30/git-repository-server-gitolite.html(specially this one)

http://kris.me.uk/2010/09/30/git-repository-server-gitolite.html(特别是这个)

http://progit.org/book/ch4-8.html

http://progit.org/book/ch4-8.html