2

How do you successfully move an existing gitolite3 installation to a new server?

I followed the instruction given here.

However after copying all the repos over from the old server (including the original gitolite-admin) and doing a push -f from a clone from the original gitolite-admin repo, gitolite3 does not update the hidden .gitolite directory on the server from the original gitolite-admin.

Here are the exact commands I ran

$ git clone git://github.com/sitaramc/gitolite
Cloning into 'gitolite'...

$ gitolite/install 
use the following full path for gitolite:
    /Users/git/gitolite/src/gitolite

$ gitolite setup -pk admin.pub 
Initialized empty Git repository in /Users/git/repositories/gitolite-admin.git/
Initialized empty Git repository in /Users/git/repositories/testing.git/
WARNING: /Users/git/.ssh/authorized_keys missing; creating a new one

The key admin.pub is the exact same key I used for the original setup.

Then I replaced the contents of the generated repositories directory with the repositories from the original server (overwriting the newly generated gitolite-admin repository).

$ gitolite setup

This command did not change the hidden .gitolite directory, the following lines were added to the log /Users/git/.gitolite/logs/gitolite-2013-07.log

013-07-09.18:03:10  19151   cli gitolite    setup
2013-07-09.18:03:10 19151       system,git add conf/gitolite.conf
2013-07-09.18:03:10 19151       system,gitolite compile
2013-07-09.18:03:10 19151       system,gitolite trigger POST_COMPILE
2013-07-09.18:03:10 19151       system,/Users/git/gitolite/src/triggers/post-compile/ssh-authkeys,POST_COMPILE
2013-07-09.18:03:10 19151       system,/Users/git/gitolite/src/triggers/post-compile/update-git-configs,POST_COMPILE
2013-07-09.18:03:10 19151       system,/Users/git/gitolite/src/triggers/post-compile/update-gitweb-access-list,POST_COMPILE
2013-07-09.18:03:10 19151       system,/Users/git/gitolite/src/commands/access,%,gitweb,R,any
2013-07-09.18:03:11 19151       system,/Users/git/gitolite/src/commands/git-config,-r,%,gitweb\.
2013-07-09.18:03:11 19151       system,/Users/git/gitolite/src/triggers/post-compile/update-git-daemon-access-list,POST_COMPILE
2013-07-09.18:03:11 19151       system,/Users/git/gitolite/src/commands/access,%,daemon,R,any
2013-07-09.18:03:11 19151   END

Then on another machine where my original clone of the original gitolite-admin is checked out, I ran:

$ git push -f
Everything up-to-date
sakra
  • 183

1 Answers1

1

As mentioned by Etan Reisner in a comment, pushing to a new remote for the new server is the crucial part. On the local machine where the original clone of the original gitolite-admin is checked out, run:

$ git remote add newserver git@newserver.local:gitolite-admin.git
$ git push newserver -f
Counting objects: 281, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (240/240), done.
Writing objects: 100% (281/281), 27.83 KiB | 0 bytes/s, done.
Total 281 (delta 85), reused 5 (delta 0)
To git@newserver.local:gitolite-admin.git
 + d7502b8...de05d2e master -> master (forced update)

On the server side the hidden .gitolite directory was updated with the original contents of the gitolite-admin repository then.

sakra
  • 183