git, gitolite error push git, gitolite error push git git

git, gitolite error push


Before you start: The gitbox is the remote machine with git and gitolite installed. The git user is the user that gitolite runs as on the gitbox.

You can overcome this error by (1) generating a new key pair, (2) registering the public key on the gitbox, and (3) by ensuring that when you connect to the gitbox, that you always connect as the git user using your new private key.

For the ninja, that’s probably enough. For the rest, here’s more detail:

Step 1) Generate a new keypair

Most IDEs have the ability to create a new public/private keypair. Alternatively, if have access to a Linux machine you can generate your own using:

ssh-keygen -t rsa -f john_git_rsa

The output will be a set of private (john_git_rsa) and public (john_git_rsa.pub) keys (aka the keypair). You'll need to copy the public key to the gitbox in the next step.

Step 2) Register new public key on gitbox

You can find out how to use git to administer gitolite-admin with a quick search of Google. Briefly, the steps are: (1) clone the gitolite-admin repository; (2) add the new public key to the gitolite-admin/keydir/ directory; and (3) push the changes back to the gitolite-admin repository. The push triggers the gitbox to register any new keys in the keydir/ folder with the authorized users list of the gitbox's git user.

Your gitbox is now ready to accept new connections from those authenticating as the git user, using the john_git_rsa private key.

Step 3) Ensure your connections to the gitbox use the git user and new private key

If you're connecting to the gitbox using terminal, edit/create the ~/.ssh/config file to include an alias that preconfigures your connection to the gitbox. The alias looks like:

Host gitbox   User git   Hostname yourgitbox.com   Port 22   IdentityFile ~/.ssh/john_git_rsa

Now, executing commands like >git clone gitbox:reponame.git, or >git push gitbox:reponame.git ensures you’re using the git user and appropriate private key. Without this alias, you'd have to do something like >git clone ssh://git@yourgitbox.com:22/reponame.git and find out the ssh switch for specifying the private key to use – not pretty. (Note: If you connect without using this alias, your default ssh key will be used and you will receive permission errors.)

OR if you use an IDE (NetBeans, Eclipse, etc.):

You need to find your IDE's SSH settings and set them to use the new private key you created (john_git_rsa) instead of the default keys it generated during its install. You also need to ensure the URI of your push repository is set to something like:

ssh://git@yourgitbox.com:22/reponame.git

that the username is set to git, and the password field is empty. This ensures that when you're connecting to the gitbox that your IDE will supply the private key you just setup and the git user.

Now your pushes should work.


Googling for "Empty compile time value given to use lib at hooks/update", first result is in Gitolite FAQ:

You're bypassing gitolite. You cloned the repo using the full path (i.e., including the repositories/ prefix), either directly on the server, or via ssh but with a key that gives you shell access.

Solution: same as for the previous bullet.

Previous bullet:

Use a different keypair for gitolite. There's a slightly longer discussion in the setup page. Also see why bypassing causes a problem and both the documents in ssh for background.


It's very good comment from #roberthernandez, but i want to add some emphasises to this.My big broblem with installing gitolite (and push'ing of course) were with checking, that '~/bin' directory is in PATH environment variable. We need use export PATH=$PATH:~/bin for set this setting. Without this option i think, gitolite can not exec his processes and has problems with PUSHing from you. Plus, after that you can use gilotile setup ... instead bin/gitolite setup ....