2009-08-27 11:54:23 +02:00
|
|
|
# installing gitolite
|
|
|
|
|
2009-11-18 10:07:04 +01:00
|
|
|
[Update 2009-11-18: easy install now works from msysgit also!]
|
|
|
|
|
2009-10-11 05:01:59 +02:00
|
|
|
This document tells you how to install gitolite. After the install is done,
|
2009-10-30 16:55:06 +01:00
|
|
|
you may want to see the [admin document][admin] for adding users, repos, etc.
|
2009-10-11 05:01:59 +02:00
|
|
|
|
2009-10-30 16:55:06 +01:00
|
|
|
[admin]: http://github.com/sitaramc/gitolite/blob/pu/doc/2-admin.mkd
|
|
|
|
|
|
|
|
There's an easy install script that requires bash (**strongly** recommended),
|
|
|
|
but if you have no bash or you're on one of the legacy Unixes there's a
|
2009-10-11 05:01:59 +02:00
|
|
|
slightly more manual process. Both are explained here.
|
|
|
|
|
|
|
|
In this document:
|
|
|
|
|
|
|
|
* easy install
|
2009-10-25 14:53:15 +01:00
|
|
|
* typical example run
|
|
|
|
* advantages over the older install methods
|
|
|
|
* disadvantages
|
2009-10-11 05:01:59 +02:00
|
|
|
* manual install
|
2009-11-06 04:29:32 +01:00
|
|
|
* upgrades
|
2009-10-11 05:01:59 +02:00
|
|
|
* other notes
|
|
|
|
* next steps
|
2009-11-18 09:07:14 +01:00
|
|
|
* appendix: server and client requirements
|
2009-10-11 05:01:59 +02:00
|
|
|
|
|
|
|
----
|
|
|
|
|
2009-10-10 09:08:22 +02:00
|
|
|
### easy install
|
|
|
|
|
2009-10-11 05:01:59 +02:00
|
|
|
There is an easy install script that makes installing very easy for the common
|
2009-11-22 05:51:22 +01:00
|
|
|
case. **This script will setup everything on the server, but you have to run
|
|
|
|
it on your workstation, NOT on the server!**
|
2009-10-10 09:08:22 +02:00
|
|
|
|
2009-10-30 16:55:06 +01:00
|
|
|
Assumptions/pre-requisites:
|
2009-10-10 09:08:22 +02:00
|
|
|
|
|
|
|
* you have a server to host gitolite
|
|
|
|
* git is installed on that server (and so is perl)
|
|
|
|
* you have a userid on that server
|
2009-10-30 16:55:06 +01:00
|
|
|
* you have ssh-pubkey (**password-less**) login to that userid
|
2009-10-10 09:08:22 +02:00
|
|
|
* (if you have only password access, run `ssh-keygen -t rsa` to create a
|
|
|
|
new keypair if needed, then run `ssh-copy-id user@host`)
|
|
|
|
* you have a clone or an archive of gitolite somewhere on your workstation
|
|
|
|
|
2009-11-13 00:33:09 +01:00
|
|
|
If so, just `cd` to that clone and run `src/gl-easy-install` and follow the
|
2009-10-10 09:08:22 +02:00
|
|
|
prompts! (Running it without any arguments shows you usage plus other useful
|
|
|
|
info).
|
|
|
|
|
2009-10-25 14:53:15 +01:00
|
|
|
#### typical example run
|
|
|
|
|
|
|
|
A typical run for me is:
|
|
|
|
|
2009-11-13 00:33:09 +01:00
|
|
|
src/gl-easy-install -q git my.git.server sitaram
|
2009-10-25 14:53:15 +01:00
|
|
|
|
|
|
|
`-q` stands for "quiet" mode -- very minimal output, no verbose descriptions
|
|
|
|
of what it is going to do, and no pauses unless absolutely needed. However,
|
|
|
|
if you're doing this for the first time or you appreciate knowing what it is
|
|
|
|
actually doing, I suggest you skip the `-q`.
|
|
|
|
|
2009-10-10 09:08:22 +02:00
|
|
|
#### advantages over the older install methods
|
|
|
|
|
|
|
|
* all ssh problems reduced to **just one pre-requisite**: enable ssh pubkey
|
|
|
|
(password-less) access to the server from your workstation first
|
|
|
|
* the script takes care of all the server side work
|
|
|
|
* when done:
|
|
|
|
* you get two different pubkeys (the original one for command line
|
|
|
|
access as before, plus a new one, created by the script, for gitolite
|
|
|
|
access)
|
|
|
|
* you can admin gitolite by commit+push a "gitolite-admin" repo, just
|
|
|
|
like gitosis (i.e., full "push to admin" power!)
|
|
|
|
|
|
|
|
#### disadvantages
|
|
|
|
|
2009-10-30 16:55:06 +01:00
|
|
|
* need a recent bash
|
2009-10-10 09:08:22 +02:00
|
|
|
|
|
|
|
### manual install
|
|
|
|
|
2009-10-30 16:55:06 +01:00
|
|
|
If you don't have bash, it's not very complicated to do it manually. Just
|
2009-11-13 00:33:09 +01:00
|
|
|
open the file `src/gl-easy-install` in a nice, syntax coloring, text
|
2009-10-30 16:55:06 +01:00
|
|
|
editor, and follow the instructions marked "MANUAL" :-)
|
2009-08-27 11:54:23 +02:00
|
|
|
|
2009-11-06 04:29:32 +01:00
|
|
|
### upgrades
|
|
|
|
|
|
|
|
Upgrading gitolite is easy.
|
|
|
|
|
|
|
|
To upgrade, pull the latest "master" (or other) branch in your gitolite repo
|
|
|
|
clone, then run the same exact command you ran to do the install, except you
|
|
|
|
can leave out the last argument.
|
|
|
|
|
|
|
|
And you might want to add a `-q` to speed things up :-)
|
|
|
|
|
|
|
|
Note that this only upgrades the software. Unlike earlier versions, it does
|
|
|
|
**not** touch the `conf/gitolite.conf` file or the contents of `keydir` in any
|
|
|
|
way. I decided that it is not possible to **safely** let an upgrade do
|
|
|
|
something meaningful with them -- fiddling with existing config files (as
|
|
|
|
opposed to merely creating one which did not exist) is best left to a human.
|
|
|
|
|
2009-10-11 05:01:59 +02:00
|
|
|
### other notes
|
2009-08-30 08:38:54 +02:00
|
|
|
|
2009-11-13 00:33:09 +01:00
|
|
|
* if you run `src/gl-easy-install` without the `-q` option, you will be
|
2009-10-30 16:55:06 +01:00
|
|
|
given a chance to edit `~/.gitolite.rc`. You can change any options (such
|
|
|
|
as paths, for instance), but be sure to keep the perl syntax -- you
|
|
|
|
*don't* have to know perl to do so, it's fairly easy to guess in this
|
|
|
|
limited case.
|
2009-08-27 11:54:23 +02:00
|
|
|
|
2009-10-11 05:01:59 +02:00
|
|
|
### next steps
|
2009-08-27 11:54:23 +02:00
|
|
|
|
2009-10-30 16:55:06 +01:00
|
|
|
The last message produced by the easy install script should tell you how to
|
|
|
|
add users, repos, etc., and you will find more details in the [admin][admin]
|
|
|
|
document.
|
2009-11-18 09:07:14 +01:00
|
|
|
|
|
|
|
<a name="server_reqs"></a>
|
|
|
|
|
|
|
|
### appendix: server and client requirements
|
|
|
|
|
|
|
|
There are 3 machines *potentially* involved in installing and administering
|
|
|
|
gitolite.
|
|
|
|
|
|
|
|
#### server
|
|
|
|
|
|
|
|
This is where gitolite is eventually installed. You need a *normal* userid
|
|
|
|
(typically "git" but can be anything) on this machine; root access is *not*
|
2009-11-22 05:51:22 +01:00
|
|
|
needed, but it has to be some sort of Unix (not Windows).
|
2009-11-18 09:07:14 +01:00
|
|
|
|
|
|
|
You need the following software on it:
|
|
|
|
|
|
|
|
* git
|
|
|
|
* can be in a non-PATH location if you are unable to install it
|
|
|
|
normally; see the `$GIT_PATH` variable in the "rc" file
|
|
|
|
* perl
|
|
|
|
* default install is fine; no special modules are needed
|
|
|
|
* (a normal install of git also requires/installs perl, so you probably
|
|
|
|
have it already)
|
|
|
|
* openssh server
|
|
|
|
* (I guess any ssh server that can understand the `authorized_keys` file
|
|
|
|
format should work)
|
|
|
|
|
|
|
|
#### install workstation
|
|
|
|
|
|
|
|
Installing or upgrading the gitolite software itself is best done by running
|
2009-11-18 10:07:04 +01:00
|
|
|
the easy-install program from a gitolite clone.
|
2009-11-18 09:07:14 +01:00
|
|
|
|
2009-11-18 10:07:04 +01:00
|
|
|
This script is heavily dependent on bash, so you need a machine with a bash
|
|
|
|
shell. Even the bash that comes with msysgit is fine, if you don't have a
|
|
|
|
Linux box handy.
|
2009-11-18 09:07:14 +01:00
|
|
|
|
2009-11-18 10:07:04 +01:00
|
|
|
If you have neither Linux nor Windows+msysgit, you still have a few
|
|
|
|
alternatives:
|
2009-11-18 09:07:14 +01:00
|
|
|
|
2009-11-18 10:07:04 +01:00
|
|
|
* use a different userid on the same server (assuming it has bash)
|
|
|
|
* use the same userid on the same server (same assumption)
|
|
|
|
* manually simulate the script directly on the server (doable, but tedious)
|
2009-11-18 09:07:14 +01:00
|
|
|
|
|
|
|
#### admin workstation(s)
|
|
|
|
|
|
|
|
When you install gitolite, it creates a repository called "gitolite-admin" and
|
|
|
|
gives you permissions on it.
|
|
|
|
|
|
|
|
Administering gitolite (adding repos/users, assigning permissions, etc) is
|
|
|
|
done by cloning this repo, making changes to a file called
|
|
|
|
`conf/gitolite.conf`, adding users' pubkeys to `keydir/`, and pushing the
|
|
|
|
changes back to the server.
|
|
|
|
|
2009-11-18 10:07:04 +01:00
|
|
|
Which means all this can be done from *any* machine. You'll normally do it
|
|
|
|
from the same machine you used to install gitolite, but it doesn't have to be
|
|
|
|
the same one, as long as your pubkey has been added and permissions given to
|
|
|
|
allow you to push to the gitolite-admin repo.
|