Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
788 views
in Technique[技术] by (71.8m points)

git - gitolite push error -> remote: ENV GL_RC not set

I am trying to push content from a workstation to a server. But it gives me an error. Please look at the following for command and error:

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'  

It seems that I need to set the environment variable GL_RC. Is this so?

Can anyone here tell me what the problem might be and how I can solve it? I am using gitolite on Windows Server 2003.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

As illustrated in the doc ssh troubleshooting, this is probably caused by an incorrect path during cloning.

The documentation (some parts below were only valid for Gitolite V2) mentions:

The second error

(ie. "you are able to clone repositories but are unable to push changes back (the error complains about the GL_RC environment variable not being set, and the hooks/update failing in some way)

happens if you use git@server:repositories/reponame.git (assuming default $REPO_BASE setting -- in Gitolite V3, it always is ~/repositories) -- that is, you used the full unix path.
Since the "prefixing" mentioned above is not required, the shell finds the repo and clones ok.
But 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.

The message that appears on a successful run of the "easy-install" program clearly includes the following warning:

*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

So in your case, you must have cloned your repo with:

git clone git@ganesh:repositories/testing.git

instead of:

git@ganesh:testing.git

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...