Archive

Posts Tagged ‘serever’

fastest way to get git server

September 17th, 2009 Comments off

I was searching for a fast and easy way to setup git server, and I found one, but I was not fully happy with it, so lets have a look on another way:

ssh mpapis@niczsoft.com -C "mkdir -p repos/library2.git; cd repos/library2.git; git --bare init"
git clone mpapis@niczsoft.com:repos/library2.git
cd library2/
touch test.txt
git add .
git commit -a -m "1st"
git push origin master

This is good way to keep Your private repo, just as central repo or backup, no packages needed, just git on both sides

The same can be done on local filesystem like shared storage(nfs or smb):

cd /remote
mkdir test.git
cd test.git/
git --bare init
cd
git clone /remote/test.git/
cd test/
touch test.txt
git add .
git commit -a -m "1st"
git push origin master

From now on it will be working by simply calling “git pull” and “git push”.

Categories: Hosting, Linux Tags: , ,