recover lost gitolite admin access

By | July 21, 2015

lost admin key/access

If you lost your gitolite admin key or access, here’s what you do. We’ll assume your username is “alice” (i.e., alice has RW or RW+ permissions on the gitolite-admin repo).

  • Make yourself a new keypair and copy the public key to the server as ‘’.
  • Log on to the server, and run gitolite setup -pk

That’s it; the new file replaces whatever existed in the repo before.

bypassing gitolite

You may have lost access because of a conf file error, in which case the above trick (which merely changes a pubkey) won’t help. What you want is to make changes to the gitolite-admin repo (or perhaps just rewind) and push that. Here’s how to do that:

  • Log on to the server.
  • Clone the admin repo using the full path: git clone $HOME/repositories/gitolite-admin.git temp.
  • Make whatever changes you want — add/replace a key, ‘git revert’ or ‘git reset –hard’ to an older commit, etc. Anything you need to fix the problem, really.
  • Run gitolite push (or possibly gitolite push -f). Note that’s ‘gitolite push’, not ‘git push’.

NOTE: gitolite does no access checking when you do this!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.