2011-11-01 06:03:20 +01:00
|
|
|
# F=install gitolite installation
|
2011-05-28 14:23:27 +02:00
|
|
|
|
|
|
|
(Note: git servers are most commonly used with ssh URLs, and this document
|
|
|
|
describes installing gitolite to support such usage. If your users prefer
|
|
|
|
http URLs, read [this][http] to install gitolite to support "smart http").
|
2009-08-27 11:54:23 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
## installing and upgrading gitolite
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-08-25 05:26:19 +02:00
|
|
|
This section tells you how to install/upgrade gitolite, without too much
|
|
|
|
background. Later sections have more details and troubleshooting info; please
|
|
|
|
read them before asking for help if you have problems.
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-08-25 05:26:19 +02:00
|
|
|
A bare minimum gitolite setup has:
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-08-25 05:26:19 +02:00
|
|
|
* a server
|
|
|
|
* a "hosting user" on the server (a real Unix userid; we use "git" in this
|
|
|
|
document, although RPM/DEB installs use "gitolite")
|
|
|
|
* a virtual "admin user" -- the user who sets up gitolite and configures it
|
|
|
|
* the admin user's client or workstation, from which he does all his work
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-08-25 05:26:19 +02:00
|
|
|
Gitolite allows 3 methods of install. The two most common are (1) the
|
|
|
|
**package method**, used if you have a gitolite RPM or a DEB available, and
|
|
|
|
(2) the **non-root method** which is the preferred manual install mode. Less
|
|
|
|
commonly used is (3) the **root method**, which is useful if you plan to have
|
|
|
|
multiple "hosting users" on the same server.
|
2011-05-28 14:23:27 +02:00
|
|
|
|
|
|
|
These install methods are described in detail below. (*Once you finish the
|
|
|
|
install, read the [admin document][admin] to administer your gitolite
|
|
|
|
installation*).
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
### F=rpmdeb package method
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-08-25 05:26:19 +02:00
|
|
|
(Unlike in the rest of this document, we use "gitolite" as the "hosting user"
|
|
|
|
instead of "git" here, because that is the user that both the Fedora and
|
|
|
|
Debian packages create. Your distro/OS may vary.)
|
2011-05-28 14:23:27 +02:00
|
|
|
|
|
|
|
On your *workstation*:
|
|
|
|
|
2012-01-10 23:23:31 +01:00
|
|
|
* copy your `~/.ssh/id_rsa.pub` file to `/tmp/YourName.pub` on the server.
|
|
|
|
(The name of this file determines your gitolite username, so if you leave
|
|
|
|
it as `id_rsa.pub`, your gitolite username will be `id_rsa`, which may not
|
|
|
|
be what you want).
|
2011-05-28 14:23:27 +02:00
|
|
|
|
|
|
|
On your *server*, as *root*:
|
|
|
|
|
|
|
|
yum install gitolite # or 'apt-get install gitolite', or whatever
|
|
|
|
# this is the only step you need to repeat when upgrading gitolite
|
|
|
|
|
|
|
|
# current RPM/DEB create a hosting user called "gitolite"
|
|
|
|
su - gitolite
|
|
|
|
|
|
|
|
# (now as gitolite)
|
|
|
|
gl-setup /tmp/YourName.pub
|
|
|
|
|
2012-01-10 23:23:31 +01:00
|
|
|
Note: if you're running non-interactively (i.e., cannot tolerate an editor
|
|
|
|
popping up), insert a "-q" before the argument to gl-setup.
|
|
|
|
|
2011-05-28 14:23:27 +02:00
|
|
|
On your *workstation*:
|
|
|
|
|
|
|
|
git clone gitolite@server:gitolite-admin
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
### F=nonroot non-root method
|
2010-02-10 11:49:20 +01:00
|
|
|
|
2011-05-28 14:23:27 +02:00
|
|
|
**IMPORTANT WARNING -- IGNORE AT YOUR PERIL**: if you want to use this method
|
2011-08-25 05:26:19 +02:00
|
|
|
you had better know the password to the hosting user on the server, or be able
|
|
|
|
to `su` to it from root, just in case you manage to lock yourself out by
|
|
|
|
messing with the keys.
|
2010-02-10 11:49:20 +01:00
|
|
|
|
2011-05-28 14:23:27 +02:00
|
|
|
**NOTE**: This method is exhaustively described in the [tutorial][tut], if
|
|
|
|
you're interested. (That tutorial is by someone else but it's nice enough for
|
|
|
|
me to link it here).
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
[tut]: http://sites.google.com/site/senawario/home/gitolite-tutorial
|
|
|
|
|
2011-05-28 14:23:27 +02:00
|
|
|
On your *workstation*:
|
|
|
|
|
2012-01-10 23:23:31 +01:00
|
|
|
* copy your `~/.ssh/id_rsa.pub` file to `/tmp/YourName.pub` on the server.
|
|
|
|
(The name of this file determines your gitolite username, so if you leave
|
|
|
|
it as `id_rsa.pub`, your gitolite username will be `id_rsa`, which may not
|
|
|
|
be what you want).
|
|
|
|
|
2011-05-28 14:23:27 +02:00
|
|
|
|
|
|
|
On your *server*, as *git* (the "hosting user"), first check if `$HOME/bin` is
|
|
|
|
on the default PATH. If not, fiddle with the `.bashrc` or `.bash_profile` or
|
|
|
|
similar files and add it somehow. Then:
|
|
|
|
|
|
|
|
git clone git://github.com/sitaramc/gitolite
|
2011-11-01 06:03:20 +01:00
|
|
|
gitolite/src/gl-system-install
|
2011-05-28 14:23:27 +02:00
|
|
|
# defaults to being the same as:
|
2011-11-01 06:03:20 +01:00
|
|
|
# gitolite/src/gl-system-install $HOME/bin $HOME/share/gitolite/conf $HOME/share/gitolite/hooks
|
2011-05-28 14:23:27 +02:00
|
|
|
|
|
|
|
# to upgrade gitolite, repeat the above commands. Make sure you use the
|
|
|
|
# same arguments for the last command each time.
|
|
|
|
|
|
|
|
gl-setup /tmp/YourName.pub
|
|
|
|
|
2012-01-10 23:23:31 +01:00
|
|
|
Note: if you're running non-interactively (i.e., cannot tolerate an editor
|
|
|
|
popping up), insert a "-q" before the argument to gl-setup.
|
|
|
|
|
2011-05-28 14:23:27 +02:00
|
|
|
On your *workstation*:
|
|
|
|
|
|
|
|
git clone git@server:gitolite-admin
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
#### F=upgrfromclient upgrading from from-client method to non-root method
|
2011-06-14 16:48:50 +02:00
|
|
|
|
|
|
|
Since the from-client method is now deprecated for reasons explained
|
|
|
|
elsewhere, some folks may want to do their next upgrade using the non-root
|
|
|
|
method.
|
|
|
|
|
|
|
|
There are many, many ways to skin this cat; here's one way:
|
|
|
|
|
|
|
|
* follow non-root install but stop after the gl-system-install step
|
|
|
|
|
|
|
|
* temporarily rename your `~/.gitolite.rc` file to something else
|
|
|
|
|
|
|
|
* now run the gl-setup step
|
|
|
|
|
|
|
|
(background: this will create a default rc file with default values, but
|
|
|
|
crucially, it will give you the correct values for two very critical
|
|
|
|
variables that are not used in the old from-client install method)
|
|
|
|
|
|
|
|
* edit `~/.gitolite.rc` and bring in any non-default settings you may have
|
|
|
|
had in your old rc file.
|
|
|
|
|
|
|
|
When you're done, the only difference between your old and current rc
|
|
|
|
files should be that the `$GL_PACKAGE_CONF` and the `$GL_PACKAGE_HOOKS`
|
|
|
|
variables are no longer commented out and look somewhat like this:
|
|
|
|
|
|
|
|
$GL_PACKAGE_CONF = '/home/git/share/gitolite/conf';
|
|
|
|
$GL_PACKAGE_HOOKS = '/home/git/share/gitolite/hooks';
|
|
|
|
|
|
|
|
Now save the file.
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
### F=root root method
|
2011-08-25 05:26:19 +02:00
|
|
|
|
|
|
|
On your *workstation*:
|
|
|
|
|
2012-01-10 23:23:31 +01:00
|
|
|
* copy your `~/.ssh/id_rsa.pub` file to `/tmp/YourName.pub` on the server.
|
|
|
|
(The name of this file determines your gitolite username, so if you leave
|
|
|
|
it as `id_rsa.pub`, your gitolite username will be `id_rsa`, which may not
|
|
|
|
be what you want).
|
|
|
|
|
|
|
|
|
2011-08-25 05:26:19 +02:00
|
|
|
|
|
|
|
On your *server*, as *root*:
|
|
|
|
|
|
|
|
git clone git://github.com/sitaramc/gitolite
|
2011-11-01 06:03:20 +01:00
|
|
|
gitolite/src/gl-system-install
|
2011-08-25 05:26:19 +02:00
|
|
|
# defaults to being the same as:
|
2011-11-17 01:20:06 +01:00
|
|
|
# gitolite/src/gl-system-install /usr/local/bin /var/gitolite/conf /var/gitolite/hooks
|
2011-08-25 05:26:19 +02:00
|
|
|
|
|
|
|
# to upgrade gitolite, repeat the above commands. Make sure you use the
|
|
|
|
# same arguments for the last command each time.
|
|
|
|
|
|
|
|
# now create your "hosting user" ('git' in our examples) using whatever
|
|
|
|
# command your distro expects you to use
|
|
|
|
|
|
|
|
# switch to the hosting user
|
|
|
|
su - git
|
|
|
|
|
|
|
|
# (now as git)
|
|
|
|
gl-setup /tmp/YourName.pub
|
|
|
|
|
2012-01-10 23:23:31 +01:00
|
|
|
Note: if you're running non-interactively (i.e., cannot tolerate an editor
|
|
|
|
popping up), insert a "-q" before the argument to gl-setup.
|
|
|
|
|
2011-08-25 05:26:19 +02:00
|
|
|
On your *workstation*:
|
|
|
|
|
|
|
|
git clone git@server:gitolite-admin
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
### #upgrade upgrading
|
|
|
|
|
|
|
|
Upgrading is easy; you just re-run some of the same commands used for install.
|
2011-11-13 03:22:26 +01:00
|
|
|
These commands are clearly noted in the install instructions above.
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
However, if you've added any new hooks, you must also run the next step (the
|
|
|
|
`gl-setup` command), although this time you don't need to supply a pubkey
|
|
|
|
filename as an argument.
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
## #insttrouble install trouble?
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-10 05:58:11 +01:00
|
|
|
If you run into trouble, please read the following sections.
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
### common install problems
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
The most common problem is usually ssh. Here are three facts of ssh:
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
* ssh is a pain
|
|
|
|
* most people don't know ssh well enough
|
|
|
|
* even people who think they do, don't
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
Please read how [gitolite uses ssh][gl_ssh] and the [ssh
|
|
|
|
troubleshooting][sts] documents before asking for help.
|
|
|
|
|
|
|
|
If you've tried multiple methods of install, you may have multiple copies of
|
|
|
|
the sources lying around. This could be a problem; see [appendix a][instpath]
|
|
|
|
for how to detect and deal with this.
|
2011-05-28 14:23:27 +02:00
|
|
|
|
|
|
|
If none of this works read the rest of this document, understand it as much as
|
|
|
|
you can, then ask for help.
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
### #instnameconv naming conventions used
|
|
|
|
|
|
|
|
Throughout the documentation, we use "YourName" as the admin user, and his
|
|
|
|
workstation is called "client". The hosting user is "git", and the server is
|
|
|
|
called "server". **Please substitute your values as needed**.
|
|
|
|
|
|
|
|
**If you're using DEB or RPM**, the installer creates a user called
|
|
|
|
"gitolite", so substitute that for "git" anywhere in the docs where the
|
|
|
|
"hosting user" is mentioned as "git".
|
|
|
|
|
|
|
|
Also, we often say "the rc file". This means `~/.gitolite.rc` on the server.
|
|
|
|
And when we say the "access control rules", or "conf file", or "config file",
|
|
|
|
we mean `conf/gitolite.conf` on your gitolite-admin clone.
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
### F=instbg helpful background information
|
2011-05-28 14:23:27 +02:00
|
|
|
|
|
|
|
* gitolite runs as a single (real) user on a server, and is invoked via ssh.
|
|
|
|
Traditionally, this "hosting user" is "git", and thus all git URLs start
|
|
|
|
with `ssh://git@server` (or the equivalent shorter form `git@server:`).
|
|
|
|
|
|
|
|
* RPM/DEB create and use "gitolite" as the hosting user
|
2010-02-10 11:49:20 +01:00
|
|
|
|
2011-04-30 03:09:01 +02:00
|
|
|
* there is *usually* only one hosting user per server (machine), but
|
|
|
|
gitolite makes it trivial to have as many as you want. In fact, every
|
2011-11-01 06:03:20 +01:00
|
|
|
user on the server is a potential hosting user.
|
2011-04-30 03:09:01 +02:00
|
|
|
|
|
|
|
* using this single user and sshd (or httpd) authentication, gitolite allows
|
|
|
|
you to create any number of "virtual" users. Virtual user names only mean
|
|
|
|
something to gitolite, and they need not be the same as any real userid on
|
|
|
|
the server or any of the clients accessing it.
|
|
|
|
|
|
|
|
* the first such virtual user is the "admin user", created during the
|
|
|
|
install sequence.
|
|
|
|
|
2011-05-28 14:23:27 +02:00
|
|
|
* gitolite depends **heavily** on ssh pubkey (passwordless) access. Do not
|
|
|
|
assume you know all about ssh -- most people **don't**. If in doubt, use
|
|
|
|
a dedicated userid on both client and server for installation and
|
|
|
|
administration of gitolite.
|
2010-02-10 11:49:20 +01:00
|
|
|
|
2010-05-21 14:23:05 +02:00
|
|
|
To make matters worse, ssh problems in gitolite don't always look like ssh
|
2011-11-01 06:03:20 +01:00
|
|
|
problems. See the [ssh troubleshooting][sts] document for help.
|
2010-02-10 11:49:20 +01:00
|
|
|
|
warning against server-side fiddling (<sigh>)
I had someone delete the admin repo on the server, then run gl-setup
again, and complain that included config files did not get restored.
There have been others (see below) before with similar demands, but
those at least had the excuse of being provoked by genuine mistakes.
This guy was intentionally breaking stuff server side.
Wish I could say he was stupid, but actually he was probably smarter
than I. Just that his idea of the limits of gitolite's responsibility
was vastly different from mine.
----
[1] There was this guy who, as root, went on a "chmod go-rwx" spree for
security, which bollixed up gitweb access to all his repos, so he tells
me gitolite should be able to fix all the permissions on the next admin
push at least? (That is, instead of just setting umask as it currently
does, it should go on a chmod spree just like he did).
[2] Then there was the guy who told me gitolite should re-create all the
"gl-creater" files for his wildcard repos because he was restoring from
a git push --mirror backup and that doesn't preserve those files? I
tried to tell him that a git push --mirror doesn't preserve "config" or
"description" or "info/exclude" or any of the other files that git (not
gitolite) maintains, but he didn't care -- losing those did not affect
him (or he never had them), but losing these affected access control,
and it's my fault.
2010-10-23 18:57:36 +02:00
|
|
|
* gitolite **does NOT** like it when people with shell access to the server
|
|
|
|
fiddle with files and directories it controls.
|
|
|
|
|
|
|
|
Apparently this was not obvious to some people.
|
|
|
|
|
2010-09-02 15:45:32 +02:00
|
|
|
It is possible to have the server and the client be the same machine, and even
|
|
|
|
the admin user be also the hosting user, (i.e., `sitaram@server` can install
|
|
|
|
and administer a gitolite setup running under `sitaram@server`, a situation
|
|
|
|
that is common with some hosting services). It's actually fairly easy and
|
|
|
|
**safe** to do, **as long as you have password access to the server** for
|
|
|
|
emergency use. However, I will not be documenting it because (a) if you know
|
|
|
|
ssh you'll know how to extrapolate my instructions to do this and (b) if you
|
|
|
|
don't know ssh it'll be a nightmare to support you.
|
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
### F=instrequire requirements
|
2009-10-10 09:08:22 +02:00
|
|
|
|
2011-05-28 14:23:27 +02:00
|
|
|
#### client/workstation
|
2009-10-10 09:08:22 +02:00
|
|
|
|
2011-08-25 15:35:29 +02:00
|
|
|
* git version 1.6.6 or greater
|
2010-05-21 14:23:05 +02:00
|
|
|
* even msysgit on Windows is fine; please don't ask me for help if
|
|
|
|
you're using putty, plink, puttygen, etc., for ssh; I recommend
|
|
|
|
msysgit for Windows and the openssh that comes with it
|
2009-10-10 09:08:22 +02:00
|
|
|
|
2011-05-28 14:23:27 +02:00
|
|
|
#### server
|
2009-10-25 14:53:15 +01:00
|
|
|
|
2010-05-21 14:23:05 +02:00
|
|
|
* any Unix system with a posix compatible "sh".
|
|
|
|
* people using "csh" or derivatives please don't ask me for help -- tell
|
|
|
|
your admin csh is not posix compatible
|
2011-11-13 03:22:26 +01:00
|
|
|
* git version 1.6.6 or later
|
2010-05-21 14:23:05 +02:00
|
|
|
* can be in a non-PATH location if you are unable to install it
|
|
|
|
normally; see the `$GIT_PATH` variable in the "rc" file
|
2011-11-13 03:22:26 +01:00
|
|
|
* perl 5.8 or later
|
2010-05-21 14:23:05 +02:00
|
|
|
* openssh or any ssh that can understand the `authorized_keys` file format
|
2011-05-05 06:01:29 +02:00
|
|
|
(probably optional if you're using the http backend)
|
2011-05-28 14:23:27 +02:00
|
|
|
* a Unix userid to be the hosting user, usually "git" but it can be any
|
|
|
|
user, even your own normal one. (If you're using an RPM/DEB the install
|
|
|
|
probably created one called "gitolite").
|
2009-10-25 14:53:15 +01:00
|
|
|
|
2011-05-28 14:23:27 +02:00
|
|
|
#### technical skills
|
2010-09-02 15:45:32 +02:00
|
|
|
|
|
|
|
* if you're installing gitolite, you're a "system admin", like it or not.
|
|
|
|
Ssh is therefore a necessary skill. Please take the time to learn at
|
|
|
|
least enough to get passwordless access working.
|
|
|
|
|
|
|
|
* you also need to be somewhat familiar with git itself. You cannot
|
|
|
|
administer a whole bunch of git repositories if you don't know the basics
|
|
|
|
of git.
|
|
|
|
|
|
|
|
* some familiarity with Unix and shells is probably required
|
|
|
|
|
|
|
|
* regular expressions are a big part of gitolite in many places but
|
|
|
|
familiarity is not necessary to do basic access control.
|
|
|
|
|
2011-11-06 15:35:15 +01:00
|
|
|
### F=getgl_ getting the gitolite software
|
2011-01-24 01:38:49 +01:00
|
|
|
|
2011-09-01 12:26:03 +02:00
|
|
|
You can get the latest version of gitolite from github or google code using
|
|
|
|
the 'git clone' command:
|
2011-01-24 01:38:49 +01:00
|
|
|
|
|
|
|
git clone git://github.com/sitaramc/gitolite.git
|
|
|
|
# (OR)
|
2011-09-01 12:26:03 +02:00
|
|
|
git clone https://code.google.com/p/gitolite/
|
2011-01-24 01:38:49 +01:00
|
|
|
|
|
|
|
#### getting a tar file from a clone
|
|
|
|
|
|
|
|
If you are on an internal network and cannot clone the gitolite repo, you can
|
|
|
|
do the clone on some other machine and create a tar file from it to use on the
|
|
|
|
internal network. Here's how:
|
|
|
|
|
|
|
|
git clone git://github.com/sitaramc/gitolite.git
|
|
|
|
# (OR)
|
|
|
|
git clone git://sitaramc.indefero.net/sitaramc/gitolite.git
|
|
|
|
cd gitolite
|
|
|
|
make master.tar
|
|
|
|
# or maybe "make pu.tar"
|
|
|
|
|
|
|
|
Please use the make command as shown, not a plain "git archive", because the
|
|
|
|
Makefile adds a file called `.GITOLITE-VERSION` that will help you identify
|
|
|
|
which version you are using.
|
|
|
|
|
2011-11-06 15:35:15 +01:00
|
|
|
## #instappendices_ appendixes
|
2010-11-14 06:35:13 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
The following sections have some miscellaneous information that does not
|
|
|
|
cleanly to fit anywhere else.
|
2010-11-14 06:35:13 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
### #instpath appendix a: PATH issues for gl-setup
|
2010-11-14 06:35:13 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
If you've tried multiple methods of install, you may have multiple copies of
|
|
|
|
the sources lying around, and when you ran `gl-setup` it picked up the wrong
|
|
|
|
one. This might also happen if the directory you supplied as the first
|
|
|
|
argument to `gitolite/src/gl-system-install` is not even in the `$PATH`.
|
2010-04-11 00:39:50 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
Run `su - git` then `which gl-setup` to see which it picked up. This is what
|
|
|
|
it should be for each method:
|
2010-04-11 00:39:50 +02:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
* RPM/DEB method: probably `/usr/bin`
|
|
|
|
* root method: the first argument to the `gitolite/src/gl-system-install` command (or
|
|
|
|
`/usr/local/bin` by default)
|
|
|
|
* non-root method: the first argument to the `gitolite/src/gl-system-install` command
|
|
|
|
(or `$HOME/bin` by default)
|
2010-03-12 05:54:53 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
If this is not what you get, remove the partially installed or extraneous
|
|
|
|
sources, if any, and try again. Or fix your `$PATH`.
|
2010-03-12 05:54:53 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
One situation that is not easy to solve is if the system admin installed
|
|
|
|
gitolite using the RPM/DEB or root methods, and you want to install a later
|
|
|
|
version using the non-root method. Since `/usr/bin` and `/usr/local/bin` are
|
|
|
|
usually earlier than `$HOME/bin` in the `$PATH`, you'll have to get creative.
|
|
|
|
Good luck.
|
2010-02-10 11:49:20 +01:00
|
|
|
|
2011-11-01 06:03:20 +01:00
|
|
|
### #clean appendix b: cleaning out a botched install
|
2010-02-10 11:49:20 +01:00
|
|
|
|
2010-05-21 14:23:05 +02:00
|
|
|
When people have trouble installing gitolite, they often try to change a bunch
|
2011-11-13 03:22:26 +01:00
|
|
|
of things manually on the server. Or sometimes they'll upgrade from one
|
|
|
|
install method to another without checking some things over properly. Or
|
|
|
|
they'll follow instructions meant for a much newer version of gitolite and
|
|
|
|
make a royal mess of the whole thing.
|
|
|
|
|
|
|
|
Here's how to clean up, without losing your actual repositories.
|
|
|
|
|
|
|
|
All this is on the server. Note that the instructions are so long because
|
|
|
|
they're generic enough to fit any situation.
|
|
|
|
|
|
|
|
* Clean out the existing install
|
|
|
|
|
2010-05-21 14:23:05 +02:00
|
|
|
* edit `~/.ssh/authorized_keys` and delete all lines between `# gitolite
|
|
|
|
start` and `# gitolite end` inclusive.
|
2010-02-10 11:49:20 +01:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
* look in `~/.gitolite.rc` for 2 variables starting with `GL_PACKAGE_`.
|
|
|
|
If they are defined (and not just commented out), you need to clean
|
|
|
|
out all gitolite related files and directories from those two paths.
|
|
|
|
|
|
|
|
Just for reference, the defaults for a non-root install are 'conf' and
|
|
|
|
'hooks' in `$HOME/share/gitolite`, while for an RPM/DEB or root
|
|
|
|
install they should be in `/var/gitolite/` or some such.
|
|
|
|
|
|
|
|
If those variables don't exist or are commented out, ignore this step.
|
|
|
|
|
|
|
|
* look in `$PATH` for any gitolite programs and delete them also. A
|
|
|
|
good way to hunt them down is `which gl-auth-command`, and in the path
|
|
|
|
you find, delete all "gl-*" programs (perhaps after checking the list,
|
|
|
|
if the path you find happens to be /usr/bin or such!!)
|
2010-03-12 05:54:53 +01:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
Repeat this step until there are no more. I know of people who mixed
|
|
|
|
different install methods and had two, or even three, versions lying
|
|
|
|
around.
|
2010-02-10 11:49:20 +01:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
* make some temp directory (say "old"), and **move** the following
|
|
|
|
files/directories into it: `~/.gitolite`, `~/.gitolite.rc` and
|
|
|
|
`~/repositories/gitolite-admin.git`. If there's nothing you need to
|
|
|
|
salvage from them you can delete them too.
|
2010-02-10 11:49:20 +01:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
* if you used an RPM/DEB install, remove the package also.
|
2010-02-10 11:49:20 +01:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
* Now install a fresh copy of gitolite using whatever method you prefer.
|
|
|
|
(If you used a different method earlier and did not clean things out
|
|
|
|
properly per the instructions given above, expect trouble).
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
* You now have a brand new "rc" file. If your old rc file had any
|
|
|
|
non-default settings you should **manually** pull them in to the new one.
|
|
|
|
However, **do NOT** change the two variables starting with `GL_PACKAGE_`
|
|
|
|
in the new rc file; even if the old one had something different leave them
|
|
|
|
alone.
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
* You also have a brand new gitolite-admin repo. Clone this to your
|
|
|
|
workstation, then use the saved copy of the old admin repo to salvage
|
|
|
|
whatever you need (entire revision history, or just the conf/key files,
|
|
|
|
whatever floats your boat).
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
Once you've got your admin repo looking how you want it, including 'repo'
|
|
|
|
statements for all your existing repos, just add/commit/push it.
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
* Go back to the server and run `gl-setup` once again (no arguments needed).
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
That should do it.
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
### #uninstall_ appendix c: uninstalling gitolite completely
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
To uninstall gitolite completely, first follow the "clean out..." steps in the
|
|
|
|
previous section.
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
If you have not really started using gitolite properly yet, you can remove all
|
|
|
|
of `~/repositories` also and be done.
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
But if you *do* need to preserve the other repos and wish to continue to use
|
|
|
|
them, remove all the `update` hooks that gitolite installs in each repository.
|
|
|
|
The easiest way is:
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
find ~/repositories -wholename "*.git/hooks/update" | xargs rm -f
|
2011-05-28 14:23:27 +02:00
|
|
|
|
2011-11-13 03:22:26 +01:00
|
|
|
but you can do it manually if you want to be careful.
|