Skip to content

Instantly share code, notes, and snippets.

@grapeot
Created July 30, 2012 20:40
Show Gist options
  • Save grapeot/3209996 to your computer and use it in GitHub Desktop.
Save grapeot/3209996 to your computer and use it in GitHub Desktop.
Gitolite Setup @ EC2
# Install git
cd $HOME
sudo yum -y update
sudo yum -y install git
# Prepare the public key, which will be used later
cp ~/.ssh/authorized_keys /tmp/Default.pub
chmod a+r /tmp/Default.pub
# Use the user git to install gitolite from source.
# More details are available in install script of gitolite
sudo adduser git
sudo su git
cd ~
git clone git://github.com/sitaramc/gitolite gitolite-source
mkdir bin
export PATH=/home/git/bin:$PATH
./gitolite-source/install -ln
gitolite setup -pk /tmp/Default.pub
exit
@grapeot
Copy link
Author

grapeot commented Jul 30, 2012

After installing gitolite, you can edit the ssh config (~/.ssh/config, create one if that doesn't exist) to make it easy to access git repo conveniently next time.

Sample lines would be like:

Host localgit
  User git
  HostName ec2-xx-xxx-xxx-xx.us-west-2.compute.amazonaws.com
  IdentityFile ~/.ssh/git

And then git clone the admin repo with

git clone localgit:gitolite-admin

Gitolite is pretty intuitive to use. Consult https://sites.google.com/site/senawario/home/gitolite-tutorial from "Step 7" for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment