Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > ba9fe7781d529b2e7b31d8489f5e0b8e > files > 11

gitolite-1.5.3-2.fc14.noarch.rpm

<h1>gitolite installatation</h1>

<p>In this document:</p>

<ul>
<li><a href="#please_read_this_first">please read this first</a>
<ul>
<li><a href="#important_notes">important notes</a></li>
<li><a href="#conventions_used">conventions used</a></li>
<li><a href="#requirements">requirements</a>
<ul>
<li><a href="#client_side">client side</a></li>
<li><a href="#server_side">server side</a></li>
</ul></li>
</ul></li>
<li><a href="#installation_and_setup">installation and setup</a>
<ul>
<li><a href="#package_method_directly_on_the_server_using_RPM_DEB">(package method) directly on the server, using RPM/DEB</a></li>
<li><a href="#root_method_directly_on_the_server_manually_with_root_access">(root method) directly on the server, manually, with root access</a></li>
<li><a href="#non_root_method_directly_on_the_server_manually_without_root_access">(non-root method) directly on the server, manually, without root access</a></li>
<li><a href="#from_client_method_install_from_the_client_to_the_server">(from-client method) install from the client to the server</a></li>
</ul></li>
<li><a href="#special_cases_multiple_gitolite_servers">special cases -- multiple gitolite servers</a>
<ul>
<li><a href="#package_method_and_root_method">package method and root method</a></li>
<li><a href="#from_client_method">from-client method</a></li>
</ul></li>
<li><a href="#upgrading">upgrading</a></li>
<li><a href="#uninstalling">uninstalling</a>
<ul>
<li><a href="#cleaning_out_a_botched_install">cleaning out a botched install</a></li>
<li><a href="#uninstalling_gitolite_completely">uninstalling gitolite completely</a></li>
</ul></li>
</ul>

<hr />

<p><a name="please_read_this_first"></a></p>

<h3>please read this first</h3>

<p><a name="important_notes"></a></p>

<h4>important notes</h4>

<p>Please make sure you understand the following points first.</p>

<ul>
<li><p>gitolite is somewhat unusual as far as "server" software goes -- every
userid on the server is a potential "gitolite host".</p></li>
<li><p>gitolite depends <strong>heavily</strong> on ssh pubkey (passwordless) access.  Do not
assume you know all about ssh -- most people <strong>don't</strong>.  If in doubt, use
a dedicated userid on both client and server for installation and
administration of gitolite.</p>

<p>To make matters worse, ssh problems in gitolite don't always look like ssh
problems.  See <a href="http://github.com/sitaramc/gitolite/blob/pu/doc/6-ssh-troubleshooting.mkd">doc/6-ssh-troubleshooting.mkd</a> for help.</p></li>
</ul>

<p><a name="conventions_used"></a></p>

<h4>conventions used</h4>

<p>We assume the admin user is "sitaram", and his workstation is called "client".
The hosting user is "git", and the server is called "server".  Substitute your
values as needed.</p>

<p><a name="requirements"></a></p>

<h4>requirements</h4>

<p><a name="client_side"></a></p>

<h5>client side</h5>

<ul>
<li>git version 1.6.2 or greater
<ul>
<li>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</li>
</ul></li>
<li>if you're using the "from-client" method of install (see below), the bash
shell is needed
<ul>
<li>again, msysgit on Windows is fine</li>
</ul></li>
</ul>

<p><a name="server_side"></a></p>

<h5>server side</h5>

<ul>
<li>any Unix system with a posix compatible "sh".
<ul>
<li>people using "csh" or derivatives please don't ask me for help -- tell
your admin csh is not posix compatible</li>
</ul></li>
<li>git version 1.6.2 or greater
<ul>
<li>can be in a non-PATH location if you are unable to install it
normally; see the <code>$GIT_PATH</code> variable in the "rc" file</li>
</ul></li>
<li>perl (but since git requires it anyway, you probably have it)</li>
<li>openssh or any ssh that can understand the <code>authorized_keys</code> file format</li>
</ul>

<p><a name="installation_and_setup"></a></p>

<h3>installation and setup</h3>

<p><a name="package_method_directly_on_the_server_using_RPM_DEB"></a></p>

<h4>(package method) directly on the server, using RPM/DEB</h4>

<ul>
<li><p>from your workstation, copy your <code>~/.ssh/id_rsa.pub</code> file to the server.
Put it in <code>/tmp/sitaram.pub</code>.</p></li>
<li><p>(U) on the server, as root, do the install (urpmi, yum, apt-get, etc.).</p></li>
<li><p>on the server, "su - git", then as "git" user, run <code>gl-setup
/tmp/sitaram.pub</code>.</p></li>
<li><p>on the client, run <code>cd; git clone git@server:gitolite-admin</code></p></li>
</ul>

<p><a name="root_method_directly_on_the_server_manually_with_root_access"></a></p>

<h4>(root method) directly on the server, manually, with root access</h4>

<ul>
<li><p>from your workstation, copy your <code>~/.ssh/id_rsa.pub</code> file to the server.
Put it in <code>/tmp/sitaram.pub</code>.</p></li>
<li><p>(U) on the server, as root, do the following:</p>

<pre><code>cd $HOME
git clone git://github.com/sitaramc/gitolite gitolite-source
cd gitolite-source
# now checkout whatever branch you want; for early adopters I suggest
# "pu", as in "git checkout -t origin/pu" for recent gits
mkdir -p /usr/local/share/gitolite/conf /usr/local/share/gitolite/hooks
src/gl-system-install /usr/local/bin /usr/local/share/gitolite/conf /usr/local/share/gitolite/hooks
</code></pre></li>
<li><p>on the server, "su - git", then as "git" user, run <code>gl-setup
/tmp/sitaram.pub</code>.</p></li>
<li><p>on the client, run <code>cd; git clone git@server:gitolite-admin</code></p></li>
</ul>

<p><a name="non_root_method_directly_on_the_server_manually_without_root_access"></a></p>

<h4>(non-root method) directly on the server, manually, without root access</h4>

<p>WARNING: if you use this method you'd better know enough about ssh to be able
to keep your keys straight, and you'd also better have password access to the
server so that if you screw up the keys you can still get on, or be able to
"su - git" from some other user on the server.</p>

<ul>
<li><p>from your workstation, copy your <code>~/.ssh/id_rsa.pub</code> file to the server.
Put it in <code>/tmp/sitaram.pub</code>.</p></li>
<li><p>if <code>$HOME/bin</code> is not on the default PATH, fiddle with your <code>.bashrc</code> or
<code>.bash_profile</code> or similar files and add it somehow.</p></li>
<li><p>(U) on the server, as "git", do the following:</p>

<pre><code>cd $HOME
git clone git://github.com/sitaramc/gitolite gitolite-source
# now checkout whatever branch you want; for early adopters I suggest
# "pu", as in "git checkout -t origin/pu" for recent gits
cd gitolite-source
mkdir -p $HOME/bin $HOME/share/gitolite/conf $HOME/share/gitolite/hooks
src/gl-system-install $HOME/bin $HOME/share/gitolite/conf $HOME/share/gitolite/hooks
</code></pre></li>
<li><p>on the server, still as "git", run <code>gl-setup /tmp/sitaram.pub</code>.</p></li>
<li><p>on the client, run <code>cd; git clone git@server:gitolite-admin</code></p></li>
</ul>

<p><a name="from_client_method_install_from_the_client_to_the_server"></a></p>

<h4>(from-client method) install from the client to the server</h4>

<p>This used to be the most common install method for a long time, and it is
still the one I use for most of my testing.  The <strong>main advantage</strong> of this
method is that it <strong>forces you</strong> to solve the ssh pubkey problem <strong>before</strong>
attempting to install.  Sadly, it also forces the admin to use a <strong>different</strong>
URL for gitolite repos than normal users, which seems to confuse a heck of a
lot of people who don't read the prominently displayed messages and/or the
documentation.</p>

<p>This method is verbosely documented in <a href="http://github.com/sitaramc/gitolite/blob/pu/doc/7-install-transcript.mkd">doc/7-install-transcript.mkd</a>,
including <em>outputs</em> of the commands concerned.</p>

<p><a name="special_cases_multiple_gitolite_servers"></a></p>

<h3>special cases -- multiple gitolite servers</h3>

<p><a name="package_method_and_root_method"></a></p>

<h4>package method and root method</h4>

<p>With the first two methods of installation, it's trivial to create multiple
gitolite instances (say one for each department, on some mega company-wide
server).  You can even do this without giving shell access to the admins.
Here's an example with just two "departments", and their admins Alice and Bob:</p>

<ul>
<li>create userids <code>webbrowser_repos</code> and <code>webserver_repos</code></li>
<li>ask Alice and Bob for their pubkeys; copy them to the respective home
directories for convenience</li>
<li>run <code>su - webbrowser_repos</code>, then <code>gl-setup alice.pub</code></li>
<li>(similarly with <code>webserver_repos</code> and <code>bob.pub</code>, and so on for others)</li>
</ul>

<p>That's it.  The URL for all web browser projects is now something like
<code>webbrowser_repos@server:reponame</code>, and similarly for the others.</p>

<p>Notice that you only have to do this once for each "department", and it's
really just one command after creating the userid.  None of these admins need
to have a command line on the server, so don't give them the passwords if you
don't need to -- the pubkey will allow them to be gitolite admins on their
domain, and that's quite enough for normal operations.</p>

<p><a name="from_client_method"></a></p>

<h4>from-client method</h4>

<p>Thanks to Matt Perzel, the easy-install command now takes an optional 4th
parameter, which is the "nickname" of the gitolite server.  It gets defined in
<code>~/.ssh/config</code>, and if not used it defaults to "gitolite".</p>

<p>So if you used the following command to install gitolite to 2 different
servers:</p>

<pre><code>./src/gl-easy-install -q git my.1st.git.server admin_user1 gitolite_server_1
./src/gl-easy-install -q git my.2nd.git.server admin_user1 gitolite_server_2
</code></pre>

<p>you will find that <code>~/gitolite_server_1-admin</code> and <code>~/gitolite_server_2-admin</code>
have been created as respective clones.  Or you can re-clone elsewhere:</p>

<pre><code>cd ~/admin1; git clone gitolite_server_1:gitolite-admin.git
cd ~/admin2; git clone gitolite_server_2:gitolite-admin.git
</code></pre>

<p><a name="upgrading"></a></p>

<h3>upgrading</h3>

<p>Upgrading gitolite is easy.  In each method above, just re-do the step that is
marked "(U)".  Also, if you're using either of the two methods that use the
<code>src/gl-system-install</code> command, please make sure you give it the same
arguments!</p>

<p>Also, remember that some new features may require additional settings in your
<code>~/.gitolite.rc</code> file.</p>

<p><a name="uninstalling"></a></p>

<h3>uninstalling</h3>

<p><a name="cleaning_out_a_botched_install"></a></p>

<h4>cleaning out a botched install</h4>

<p>When people have trouble installing gitolite, they often try to change a bunch
of things manually on the server.  This usually makes things worse ;-) so
here's how to clean the slate.</p>

<ul>
<li>client-side
<ul>
<li>edit <code>~/.ssh/config</code> and delete the paragraph starting with <code>host
gitolite</code>, if present.</li>
<li>remove <code>~/gitolite-admin</code></li>
</ul></li>
<li>server-side
<ul>
<li>edit <code>~/.ssh/authorized_keys</code> and delete all lines between <code># gitolite
start</code> and <code># gitolite end</code> inclusive.</li>
<li>remove <code>~/.gitolite</code>, <code>~/.gitolite.rc</code> and
<code>~/repositories/gitolite-admin.git</code></li>
</ul></li>
</ul>

<p><a name="uninstalling_gitolite_completely"></a></p>

<h4>uninstalling gitolite completely</h4>

<p>There's some duplication between this and the previous section, but
uninstalling gitolite is described in great detail in
<a href="http://github.com/sitaramc/gitolite/blob/pu/doc/9-uninstall.mkd">doc/9-uninstall.mkd</a></p>

<hr />