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
  • You ran gitolite setup? What does the output from git push -f in the gitolite-admin repo say is happening? – Etan Reisner Jul 9 '13 at 15:54
  • See updated question. – sakra Jul 9 '13 at 16:12
  • 1
    You missed the part about adding a new remote for the new server before the push. You need to do that so the push -f goes to the new server. – Etan Reisner Jul 9 '13 at 16:40
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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.