Master – test06 (

Backup – test12.

Steps to install GIt-web using apache

As root

#apt-get install git-core gitweb libapr1-dev libaprutil1-dev

#chmod -R 777 /usr/lib/git-core

#chmod 777 /etc/gitweb.conf

#vi /etc/gitweb.conf   ---- change the repository path as per requirement.

#chmod -R 777 /usr/share/gitweb

#adduser --system --shell /bin/bash --group  --home /home/git git

#su - git

As user git

#mkdir /home/git/repo

#cd downloads/


#tar -zxf httpd-2.4.17.tar.gz

#cd httpd-2.4.17/

#./configure --prefix=/home/git/apache2 --enable-cgi --enable-cgid --enable-vhost-alias --enable-rewrite --enable-authnz-ldap --enable-so --enable-expires --enable-headers --enable-thread-safety --enable-ldap --with-port=8765


#make install

#cd apache2/conf/

#vi httpd.conf

<strong>Uncomment modules and add entries that are missing
LoadModule authnz_ldap_module modules/

LoadModule ldap_module modules/

LoadModule cgid_module modules/

LoadModule cgi_module modules/

LoadModule vhost_alias_module modules/

LoadModule rewrite_module modules/ 

Add another conf file for git-web setup under ~/apache/conf

#vi git-http-site.conf   (check this file and make changes accordingly)

Then again open httpd.conf and add the below line in the end if the file.

Include conf/git-http-site.conf

IMP scripts (Create and initialiazes new bare repor in directory expose via http also setup back repo) (setups initial mirror for backup)

Steps to create New repository

#ssh root@test06

#su - git

#cd bin

git@test06:~bin$ ./ 

Provide the name of the repo (eg. project.git): .git

Then after login to test12 and run command below

#ssh root@test12

#su - git

#cd bin

#git@test12:~bin$ ./

Provide the name of the repo (eg. project.git): .git  

Creating a new repository


git@test06:~/bin$ ./ hariproject1.git 

Provide the name of the repo (eg. project.git): hariproject1.git

Initialized empty Git repository in /home/git/repo/hariproject1.git/


git@test12:~/bin$ ./

Provide the name of the repo (eg. project.git): hariproject1.git

Cloning into bare repository 'hariproject1.git'...

warning: You appear to have cloned an empty repository. 

On client side.

hari@test56:~$ git clone hariproject1

hari@test56:~/hariproject1$ touch README

hari@test56:~/hariproject1$ touch sample.c

hari@test56:~/hariproject1$ vi sample.c

hari@test56:~/hariproject1$ git add README

hari@test56:~/hariproject1$ git add smaple.c

fatal: pathspec 'smaple.c' did not match any files

hari@test56:~/hariproject1$ git add sample.c

hari@test56:~/hariproject1$ git commit -m "some_message"

hari@test56:~/hariproject1$ git config --global ""

hari@test56:~/hariproject1$  git config --global "hari" 

Push the changes to the master repo

hari@test56:~/hariproject1$ git push origin master

hari@test56:~/hariproject1$ git push origin master

Username for '': hari

Password for '':

Counting objects: 6, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (3/3), done.

Writing objects: 100% (6/6), 462 bytes | 0 bytes/s, done.

Total 6 (delta 0), reused 0 (delta 0)

remote: To

remote:  * [new branch]      master -> master


* [new branch]      master -> master