old server
# backup repositories somehow. user$ tar czvf repo.tgz /path/to/gitolite/repositories/
new server
user$ sudo yum install gitolite user$ rpm -qa | grep gitolite gitolite-2.3.1-1.el5 user$ sudo su -l gitolite # initialize gitolite with dummy pub key gitolite$ ssh-keygen -q -N '' -f dummy gitolite$ gl-setup dummy.pub creating gitolite-admin... Initialized empty Git repository in /var/lib/gitolite/repositories/gitolite-admin.git/ creating testing... Initialized empty Git repository in /var/lib/gitolite/repositories/testing.git/ [master (root-commit) a523b5b] gl-setup dummy.pub 2 files changed, 8 insertions(+), 0 deletions(-) create mode 100644 conf/gitolite.conf create mode 100644 keydir/dummy.pub # change it same as old server if you neeed gitolite$ vim .gitolite.rc # swap repositories directory with backup gitolite$ rm -rf ./repositories gitolite$ cd /path/to/backup/ gitolite$ tar xzvf repo.tgz gitolite$ mv repositories /var/lig/gitolite/ # overwrite repository by empty commiting gitolite$ cd /tmp gitolite$ git clone /var/lib/gitolite/repositories/gitolite-admin.git Cloning into gitolite-admin... done. gitolite$ cd gitolite-admin gitolite$ git commit --allow-empty -m 'move gitolite server' [master 1656534] move gitolite server gitolite$ gl-admin-push -f Counting objects: 1, done. Unpacking objects: 100% (1/1), done. Writing objects: 100% (1/1), 190 bytes, done. Total 1 (delta 0), reused 0 (delta 0) To /var/lib/gitolite/repositories/gitolite-admin.git d36c1e8..1656534 master -> master gitolite$ exit # confirm user$ git clone ssh://gitolite@localhost/gitolite-admin Cloning into gitolite-admin... remote: Counting objects: 62, done. remote: Compressing objects: 100% (54/54), done. Receiving objects: 100% (62/62), 8.95 KiB, done. remote: Total 62 (delta 12), reused 0 (delta 0) Resolving deltas: 100% (12/12), done.
done! :)
Thanks
http://sitaramc.github.com/gitolite/rare.html#existinghttp://stackoverflow.com/questions/9835235/moving-gitolite-server
0 件のコメント:
コメントを投稿