4

I have a system setup with git and gitolite. All is working well, except I want my structure to be like this:

Local Environment -> Development Server -> Production Server

I have a repo setup on the dev server, and it's successfully cloned down to the local environment. Now, what I need is a local filesystem working copy on the development server but I'm not sure how to do this with gitolite.

git clone /home/gitolote/repositories/myrepo.git

Works fine until I try to push/pull, at which point I get this:

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

Any ideas on how to do this with gitolite?

Colin M
  • 11,952
  • 3
  • 33
  • 55

2 Answers2

8

You are using the local protocol for your clone, which means you are bypassing gitolite entirely (the gitolite script is called through a ssh forced command).

You should make a second clone on your development server, using a gitolite compatible address like:

git clone git@gitoliteserver:myrepo.git

That second repo would be able to push/pull to/from the gitolite server, while providing the "local filesystem working copy" on the development server you are after.

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • Thanks. It was weird setting up a public key for the local user account but all worked out in the end. – Colin M May 02 '11 at 07:47
3

If you require using the local protocol, all you need is to set GL_BYPASS_UPDATE_HOOK environment variable to 1:

gorgo@somegitoliteserver:~/testing$ GL_BYPASS_UPDATE_HOOK=1 git push
Counting objects: 3, done.
Delta compression using up to 3 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 234 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (2/2), done.
To file:///home/gitolite/repositories/testing.git/
96be337..ab5ca6d  master -> master
Ikar Pohorský
  • 3,559
  • 2
  • 29
  • 49