Skip to content

Instantly share code, notes, and snippets.

@dzaporozhets
Created September 20, 2012 08:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dzaporozhets/3754594 to your computer and use it in GitHub Desktop.
Save dzaporozhets/3754594 to your computer and use it in GitHub Desktop.
sudo adduser \
--system \
--shell /bin/sh \
--gecos 'git version control' \
--group \
--disabled-password \
--home /home/git \
git
# ubuntu/debian
sudo adduser --disabled-login --gecos 'gitlab system' gitlab
sudo usermod -a -G git gitlab
sudo -H -u gitlab ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
cd /home/git
sudo -H -u git git clone -b gl-v304 https://github.com/gitlabhq/gitolite.git /home/git/gitolite
cd /home/git
sudo -u git -H mkdir bin
sudo -u git sh -c 'echo -e "PATH=\$PATH:/home/git/bin\nexport PATH" >> /home/git/.profile'
sudo -u git sh -c 'gitolite/install -ln /home/git/bin'
sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
sudo chmod 0444 /home/git/gitlab.pub
sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gitolite setup -pk /home/git/gitlab.pub"
sudo -u git -H sed -i 's/0077/0007/g' /home/git/.gitolite.rc
sudo chmod -R g+rwX /home/git/repositories/
sudo chown -R git:git /home/git/repositories/
# clone admin repo to add localhost to known_hosts
# & be sure your user has access to gitolite
sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin
# if succeed you can remove it
sudo rm -rf /tmp/gitolite-admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment