Migration of existing user repos from gitolite
Any existing repositories that refer to the old gitosis service (pre 2013) need to be updated to point instead to the new gitolite service. To determine if your repo points to the old service, use:
% git remote -v origin firstname.lastname@example.org:changeme.git (fetch) origin email@example.com:changeme.git (push)
There might be other entries if you also have a github remote alias. To update the gitosis entries, use (change origin to whatever appears before the gitosis@darkmatter... lines displayed by git remote -v and remember to change changme.git to the actual repo name):
git remote rm origin git remote add origin firstname.lastname@example.org:changeme.git
At this point, everything should be back in synch and you can safely use gitopic on any open topic branches. Remember to do this for all of your existing checkouts of any of the following packages that were hosted on the original gitolite service:
baofit bosslya challenge10 cosmo gbapp imengine ksb likely lost
Add new user
Changes are made to a local checkout of the gitolite-admin package and then pushed back to the server. Only user dkirkby can make changes to this package.
Copy their laptop public key to .../keydir/<username>.pub. Optionally, also copy their darkmatter key to .../keydir/darkmatter/<username>.pub being sure to use the same username.
Append the new username to the @groups line in .../conf/gitolite.conf
Commit and push changes back to the server.
See here for details.
Add a new package
Append the new package name to the line that begins repo baofit bosslya ....
Commit and push changes back to the server. This creates a bare empty package on the server. From here, there are two options:
Brand new package
If the package is brand new, make a local clone of the new package and start committing to it (change changeme below!):
git clone email@example.com:changeme.git
See here for details.
Existing local package
If, instead, you have already made some commits to a local repo and just want to start tracking it on the server, use:
git remote add origin firstname.lastname@example.org:changeme.git git push --all origin
Debug ssh Problems
This is a useful command to run from the server:
sudo -u git -H /usr/local/bin/gitolite sshkeys-lint
For details on ssh troubleshooting, see here.
Create git user following these instructions.
The following clones gitolite into /usr/local/etc/gitolite and makes a soft-link /usr/local/bin/gitolite for the top-level script:
sudo adduser --system --shell /bin/sh --gecos 'Git Version Control' --group --disabled-password --home /home/git git cd /usr/local/etc sudo git clone git://github.com/sitaramc/gitolite sudo chown -R git:git gitolite sudo gitolite/install -ln /usr/local/bin # public key from my laptop already copied to the server sudo cp dkirkby.pub /home/git/ sudo -u git -H /usr/local/bin/gitolite setup -pk /home/git/dkirkby.pub
To remove gitolite, use:
sudo deluser --remove-all-files git
Test that it is working from my laptop (use full path to ssh to bypass any alias):
% /usr/bin/ssh email@example.com info hello dkirkby, this is git@darkmatter running gitolite3 v3.3-7-g3e87a08 on git 188.8.131.52 R W gitolite-admin R W testing
Do initial checkout of admin package on my laptop:
cd /home/dkirkby/git git clone firstname.lastname@example.org:gitolite-admin darkmatter
Migration of Gitosis bare repos
Copy bare git packages from gitosis under /backup/darkmatter/srv/gitosis mostly following these generic instructions, but see also these gitosis specific instructions (but we are not trying to migrate gitosis config):
cd /home/git/repositories/ sudo cp -R /backup/darkmatter/srv/gitosis/repositories/*.git . sudo rm -R gitosis-admin.git sudo chown -R git:git . sudo -u git -H /usr/local/bin/gitolite setup
I probably should have deleted gitosis-admin.git before running the setup command above. Instead, I actually deleted it afterwards.
Add the following lines to gitolite-admin/conf/gitolite.conf on my laptop then commit and push back to the server:
@group = dkirkby dmargala repo baofit bosslya challenge10 cosmo gbapp imengine ksb likely lost RW+ = @group