Friday, March 13, 2015

Move Rebuild the Gitolite server

Here is how I moved or rebuild the gitolite server.

My old gitolite version is 1.x.
Mark IP:[]
Clone your old gitolite-admin repo to somewhere.

The new gitolite I install on Debian 7 Wheezy through backports.
Mark IP:[]

  1. Make sure generate ssh key before you install gitolite3.

  2. Install gitolite3.

  3. # apt-get update
    # apt-get install gitolite3

    It will asking you for the public key.

  4. Clone the gitolite-admin somewhere.

  5. # git clone gitolite3@

  6. copy the gitolite-adminconfgitolite.conf from old gitolite-admin repo to new gitolite-admin repo.

  7. Be careful of the admin for repo gitolite-admin.
    Make sure you have the key for the permission.

  8. copy the keys gitolite-adminkeydir* from old gitolite-admin repo to new gitolite-admin repo.

  9. copy all the repos from the old server to new server into a temp folder:.

  10. # scp -r root@ /tmp

  11. Drop the gitolite-admin and any other retired repo, then move them into the new gitolite3 repository folder:.

  12. # rm -rf /tmp/repositories/gitolite-admin.git/
    # rm -rf /tmp/repositories/testing.git/

    # mv /tmp/repositories/* /var/lib/gitolite3/repositories/

  13. Make sure the files end up with the right ownership and permissions; if not, chown/chmod them..

  14. I found most easy way to do it run scp by gitolite3 user.

  15. Push the changes on the new gitolite-admin repo:.

  16. # git add keydir/
    # git commit -a
    # git push

    And you are all set.

No comments:

Post a Comment