Skip to content

Instantly share code, notes, and snippets.

@masnick
Created June 20, 2011 15:36
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save masnick/1035834 to your computer and use it in GitHub Desktop.
Save masnick/1035834 to your computer and use it in GitHub Desktop.
Setting up gitolite (hn)
# Assuming Ubuntu 10.04 with git already installed.
#
# Make sure to secure your server: http://www.andrewault.net/2010/05/17/securing-an-ubuntu-server/
# These instructions are based on:
# http://sitaramc.github.com/gitolite/doc/1-INSTALL.html:
# First, get you id_rsa.pub onto the server as /tmp/YourName.pub
scp ~/ssh/id_rsa.pub you@git.you.com:/tmp/
# Then, as root:
cd $HOME
git clone git://github.com/sitaramc/gitolite gitolite-source
cd gitolite-source
git branch # "pu" should be the selected branch. if not: "git checkout -t origin/pu"
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
su git
# If you see "Unknown id: git"...
adduser git # (password doesn't matter - use a strong, random password)
# Now..
su git
which gl-setup # should yield "/usr/local/bin/gl-setup"
gl-setup /tmp/YourName.pub # vim will open, type ":wq" and press enter to continue
# Note that if you want multiple ssh keys for yourself, use YourName@laptop.pub and YourName@desktop.pub, etc.
# Now, on your local computer in a convenient place run:
git clone git@git.you.com:gitolite-admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment