forked from gitlabhq/gitlabhq
-
Notifications
You must be signed in to change notification settings - Fork 1
Reinstall gitolite
riyad edited this page Dec 24, 2012
·
12 revisions
This guide allow to quickly setup gitolite v3 from scratch saving existing repositories
sudo mv /home/git/repositories /home/gitlab/bk/
sudo userdel -r git
sudo adduser \
--system \
--shell /bin/sh \
--gecos 'git version control' \
--group \
--disabled-password \
--home /home/git \
git
sudo usermod -a -G git gitlab
sudo -H -u git git clone -b gl-v320 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"
cd /home/gitlab/bk
sudo cp -R ./ /home/git/repositories
sudo chmod -R ug+rwXs,o-rwx /home/git/repositories/
sudo chown -R git:git /home/git/repositories/
sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin
cd /home/gitlab/gitlab/
sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive
sudo chown git:git /home/git/.gitolite/hooks/common/post-receive
sudo -u gitlab -H bundle exec rake gitlab:gitolite:update_keys RAILS_ENV=production
sudo -u gitlab -H bundle exec rake gitlab:gitolite:update_repos RAILS_ENV=production
# for GitLab 3.1 and earlier
sudo -u gitlab -H bundle exec rake gitlab:app:enable_automerge RAILS_ENV=production
# for GitLab 4.0 and later
sudo -u gitlab -H bundle exec rake gitlab:enable_automerge RAILS_ENV=production