cat /etc/debian_version
7.7
sudo aptitude install nginx git-core git-doc fcgiwrap
sudo adduser git
sudo su - git
mkdir -p /home/git/repositories/test.git
cd /home/git/repositories/test.git
git --bare init --shared=group
mkdir ~/test
cd ~/test
git init
echo "Hello git project" > README
git add .
git commit -m "first push"
git push /home/git/repositories/test.git master
cd /home/git/repositories/test.git
cp -pi hooks/post-update.sample hooks/post-update
git update-server-info
git config http.receivepack true
[Nginx]
sudo vim /etc/nginx/conf.d/git.conf
server {
listen 80;
server_name git.example.com;
access_log /var/log/nginx/git_access_log;
error_log /var/log/nginx/git_error_log;
location /repositories {
root /home/git/;
fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
fastcgi_param GIT_PROJECT_ROOT /home/git;
fastcgi_param GIT_HTTP_EXPORT_ALL "";
fastcgi_param PATH_INFO $uri;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
include /etc/nginx/fastcgi_params;
}
}
[server]
sudo /etc/init.d/fcgiwrap restart
sudo /etc/init.d/nginx restart
[local]
git clone http://git.choiq.com/repositories/test.git
reference materials: