Monday, March 10, 2014

Configuring a local git server


1) Create a git user and add all users that need to access git to that group:

sudo adduser git
sudo usermod -a -G git git


2) Create a server git repository:

su - git
mkdir prototype_www.git

pwd  (we are at /home/git)
cd prototype_www.git
git --bare init


* give group perms
git config core.sharedRepository true
sudo chown -R git:git /home/git/prototype_www.git



3) Create a client git repository:

(login to a user account such as 'david')
mkdir pcap
cd pcap
vi README

git init
git add .
git commit -m 'initial commit'
git remote add origin git@127.0.0.1:/home/git/prototype_www.git
git push origin master

No comments: