https://wiki.archlinux.org/api.php?action=feedcontributions&user=Disasm90&feedformat=atomArchWiki - User contributions [en]2024-03-28T20:30:35ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Gitolite&diff=222067Gitolite2012-09-08T09:44:37Z<p>Disasm90: </p>
<hr />
<div>[[Category:Version Control System]]<br />
[https://github.com/sitaramc/gitolite/wiki/ Gitolite] allows you to host Git repositories easily and securely.<br />
<br />
== Installation ==<br />
{{AUR|gitolite-git}} is available in the [[Arch User Repository]].<br />
<br />
It is also available on [https://github.com/sitaramc/gitolite/tree/master github], where you can find the last update.<br />
<br />
== Configuration ==<br />
Add a user<br />
# useradd -m -U -r -s /bin/bash -d /srv/git git<br />
# su - git<br />
$ gitolite setup -pk id_rsa.pub<br />
<br />
Add to your work-machine's ~/.ssh/config:<br />
Host server<br />
HostName 192.168.12.2<br />
User git<br />
### IdentityFile specifies the private ssh-key<br />
IdentityFile ~/.ssh/id_rsa<br />
<br />
<br />
Do NOT add repos or users directly on the server! You MUST manage the server by cloning the special 'gitolite-admin' repo on your workstation:<br />
$ git clone server:gitolite-admin<br />
<br />
== Add users ==<br />
Ask each user who will get access to send you a public key. On their workstation generate the pair of ssh keys:<br />
$ ssh-keygen<br />
Rename each public key according to the user's name, with a .pub extension, like sitaram.pub or john-smith.pub. You can also use periods and underscores. Have the users send you the keys.<br />
<br />
Copy all these *.pub files to keydir in your gitolite-admin repo clone. You can also organise them into various subdirectories of keydir if you wish, since the entire tree is searched.<br />
<br />
Edit the config file (conf/gitolite.conf in your admin repo clone). See the gitolite.conf documentation (http://sitaramc.github.com/gitolite/admin.html#conf) for details on what goes in that file, syntax, etc. Just add new repos as needed, and add new users and give them permissions as required. The users names should be exactly the same as their keyfile names, but without the .pub extension<br />
$ nano conf/gitolite.conf<br />
<br />
Commit and push the changes them:<br />
git commit -a<br />
git push<br />
<br />
== Gitosis-like usernames ==<br />
If you want to distinguish users with the same login (like username@server1, username@server2) you may want to do the following (for gitolite-3.04-1):<br />
<br />
* edit /usr/lib/gitolite/triggers/post-compile/ssh-authkeys and replace<br />
$user =~ s/(\@[^.]+)?\.pub$//; # baz.pub, baz@home.pub -> baz<br />
by<br />
$user =~ s/\.pub$//; # baz@home.pub -> baz@home<br />
* update authorized_keys file (for example, by pushing into gitolite-admin repo)<br />
<br />
== See also ==<br />
http://sitaramc.github.com/gitolite/index.html</div>Disasm90