Git Normal paket olarak kuruyoruz

$ sudo apt-get install git-core

git config –global “Your Name”
git config –global
SSH Key:

Generate ssh public/private key on the machine you would like to access git repo from and copy it to the server into the /tmp/ directory, for reference here is the command:

$ ssh-keygen -t rsa -C "name@computer"

Installing Gitolite:

$ sudo apt-get install gitolite

Create a user to access gitolite with, in this case I chose git since I don’t like to type:

sudo adduser \
–system \
–shell /bin/bash \
–gecos ‘git version control’ \
–group \
–disabled-password \
–home /home/git \

Now login to the newly created user, and set the path, and move to its home directory:

$ sudo su git

$ echo "PATH=$HOME/bin:$PATH" > ~/.bashrc

Run the gitolite setup command with the public key you copied to the tmp directory to initialized the location for gitolite use. Then change the $REPO_UMASK to 0027 when it opens the .gitolite.rc for editing during the installation process. If it didn’t open the file for any reason just open it up in vim (Note this is only if you’d like to use gitweb):

$ gl-setup /tmp/

# change $REPO_UMASK = 0077; to $REPO_UMASK = 0027; # gets you ‘rwxr-x—‘
Afterward, it has made the gitolite-admin.git, testing.git repo and all other necessary files. Check to see that everything works by cloning the repo on the machine with the public/private key.

$ git clone git@:gitolite-admin.git

Here is a resource about the syntax for the config file and adding users.

Install Gitweb:

This is the tricky bit… Install gitweb and the highlight app. Gitweb is located at ‘/usr/share/gitweb’

$ sudo apt-get install highlight gitweb

Edit the gitweb config to the locations of the project list and repos, and add the highlighting bit at the end of the file:

$ sudo vim /etc/gitweb.conf

# change $projectroot to /home/git/repositories
# change $projects_list to /home/git/projects.list
# Add Highlighting at the end
$ feature{‘highlight’}{‘default’} = [1];

Change gitolite instance to allow access for gitweb. First append www-data to git group so gitweb can access the repos, then change the permissions for git repos and the projects list, finally restart apache:

$ sudo service apache2 restart
$ sudo usermod -a -G git www-data
$ sudo chmod g+r /home/git/projects.list
$ sudo chmod -R g+rx /home/git/repositories
$ sudo service apache2 restart

Finally you need to tell gitolite which repo you want to show up in gitweb. To do this edit the gitolite.conf file from the gitolite-admin.git repo:

Repo testing:

RW+ = @all
R = gitweb

Gerekli değişikliklerden sonra:

$ git push origin master

when done, instead of git push , use this program instead. For example, instead of git push -f, use

$ gl-admin-push -f.

işlem yapıyor mu görmek için:

$ tailf /home/git/gitlab/log/production.log

restart etmek için:

$ service gitlab restart

Not: Aşağıdaki gibi bir hata alınıyorsa, muhtemelen dosya boyutu büyük olduğu için timeout’a düşüyordur.

error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502 Bad Gateway
fatal: The remote end hung up unexpectedly


$ vi /home/git/gitlab/config/unicorn.rb

dosyasında timeout değeri artırılır.

$ service gitlab restart

Bu Kadar!