Table of Contents
Find all docs of gitolite at http://sitaramc.github.com/gitolite/master-toc.html
Howto install gitolite3 from backports. Adding backports to your sources.list is described here.
The following steps are to be performed on the server where your repos will reside.
aptitude -t wheezy-backports install gitolite3
The home directory of gitolite3 in Debian is
Next, add your SSH pulic key to gitolite3 (the part that usually goes to the authorized_key file). This way you will become the admin of gitolite.
You can do this in two ways:
# the Debian way: dpkg-reconfigure gitolite3 # or the manual approach: su gitolite gl-setup /tmp/user.pub
Now you are done on the server. Move on to your workstation:
git clone gitolite3@server:gitolite-admin
All administration of gitolite will be done on your workstation, NOT on the server as gitolite!
To add users to gitolite you just need the pubkey of each user. Put the pubkey into keydir/johndoe.pub (.pub is required!), add the new pubkey, commit and push:
git add johndoe.pub git commit -m "add johndoe pubkey" git push origin
Adding a repo is easy: edit conf/gitolite.conf:
repo dotfiles RW+ = johndoe
Then you add, commit and push the change to gitolite as it was done before.
Your new repo will be created automagically the first time you push your first commits to it.
Messed up your install?
See “appendix b: cleaning out a botched install”
repo dotfiles RW+ = johndoe janedoe RW = ben R = tim
- R means “read” permission
- RW means “read and write”, but no rewind
- RW+ means “read and write”, with rewind allowed
A “rewind” means “non-fast forward push”
@group1 = ben tim repo workbench RW = @group1
See all the details here: http://sitaramc.github.com/gitolite/bac.html
Move a pre-existing Repo into Gitolite
- create a fresh empty repo with gitolite as described above
- move into your clone on your workstation
- run these commands:
git push --all gitolite3@server:reponame git push --tags gitolite3@server:reponame
- done → you can clone now from gitolite
Rename a Repository
To rename a repository that already exists do the following (in this order, do not revese):
- log into the server
move oldname.git newname.git
- on your workstation, on the gitolite-admin clone edit
- replace all occurences of oldname with newname
- add, commit and push
- done :)
Move a Repository to a New Server
Imagine you have to move your repo to a new server. This is how to do it:
mkdir tmp && cd tmp git clone --mirror email@example.com:repo-name cd repo-name git remote set-url origin firstname.lastname@example.org:repo-name git remote -v git push --mirror
In every clone you have to change the origin to the new server:
git remote set-url origin email@example.com:repo-name
To make a new clone everything is straight forward:
git clone firstname.lastname@example.org:repo-name