gitolite推错误 - >远程:ENV GL_RC未设置(gitolite push er

2019-10-29 18:47发布

我试图从工作站到服务器推送内容。 但它给了我一个错误。 请看下面的命令和错误:

Administrator@ganesh ~/testing  
$ git push origin master  
Counting objects: 3, done.  
Writing objects: 100% (3/3), 241 bytes, done.  
Total 3 (delta 0), reused 0 (delta 0)  
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  
To git@ganesh:repositories/testing  
 ! [remote rejected] master -> master (hook declined)  
error: failed to push some refs to 'git@ganesh:repositories/testing'  

看来我需要设置环境变量GL_RC 。 这是这样的吗?

这里谁能告诉我是什么问题是,我该如何解决呢? 我使用Windows Server 2003上gitolite。

Answer 1:

如在doc所示SSH故障排除 ,这可能是由克隆的过程中的不正确的路径导致的。

文档(以下某些部分仅适用于Gitolite V2)中提到:

第二个错误

(即“你能克隆库,但无法更改推回(有关错误抱怨GL_RC环境变量没有被设置,以及钩/更新以某种方式失败)

发生如果您使用git@server:repositories/reponame.git (假设默认 $REPO_BASE 设置-在Gitolite V3 ,它始终是~/repositories ) -也就是说, 您使用完整的路径
由于不需要上述的“前缀”,壳发现回购和克隆确定。
但是,当你推,gitolite的更新勾踢,而无法运行,因为一些环境变量,它期待的是不存在的。

,关于“易安装”方案明确包括如下警告的成功运行将出现消息:

*Your* URL for cloning any repo on this server will be
        gitolite:reponame.git

    *Other* users you set up will have to use
        <user>@<server>:reponame.git
    However, if your server uses a non-standard ssh port, they should use
        ssh://<user>@<server>:<port>/reponame.git

所以你的情况,你必须有你的克隆与回购:

git clone git@ganesh:repositories/testing.git

代替:

git@ganesh:testing.git


Answer 2:

在SSH故障排除文档http://sitaramc.github.com/gitolite/doc/ssh-troubleshooting.html (以及在gitolite源回购)已经完全现在重新加工。 我希望它流好多了,并解释了事情变得更加容易,包括此特定错误。

我还要补充一点,您应阅读充满了文件,至少第一次。

Sitaram



Answer 3:

刚刚得到了同样的错误。

正确的答案是,你需要使用git clone gitolite:repo_name命令克隆库和git push gitolite:repo_name推的变化,而不是git clone git@yourservername:repo_name



Answer 4:

Try to:

ssh git@ganesh

You should see gitolite-shell instead of bash:

ssh git@localhost

PTY allocation request failed on channel 0 hello
id_rsa, the gitolite version here is 2.0.3-2 (Debian) the gitolite
config gives you the following access:
     R   W  gitolite-admin
    @R_ @W_ testing
Connection to localhost closed.

If not it means you bypass gitolite-shell and use bash instead. The reason might be, that by running gl-setup your_pub_key.pub you added your key to the bottom of /home/git/.ssh/authorized_keys file.

Therefore, this key is never reached, because there are other keys at the top. So, you simply need to open /home/git/.ssh/authorired_keys and move the recently added gitolite key to the top of the file.

After moving this record to the top of the file, you should be able to use: git clone git@ganesh:testing.git insead of git clone git@ganesh:repositories/testing.git The second one clones the repo but leads to the error, because you run "git push" via bash instead of gitolite-shell



文章来源: gitolite push error -> remote: ENV GL_RC not set