Git How to setting up bare remote repository in VPN network
1)
First setup the bare remote repository:
===============================
a)
ssh to remote system
#ssh root@192.168.12.164
b)
Create a new dir
#cd /root/projects/
#mkdir myproject.git
c)
Goto to new dir
#cd myproject.git
d)
Run git init
#git init --bare
e)
For serve via HTTP
#git update-server-info
2)
On local machine:
================
a)
Goto your project dir
#cd myproject
b)
Run git init
#git init
c)
Add all files to git
#git add *
d)
Commit
#git commit -m "My initial commit message"
e)
Add remote bare repo
#git remote add origin root@192.168.12.164:projects/myproject.git
f)
Push changes to remote bare repo
#git push -u origin master
3)
Clone from remote bare repository
============================
a)
Goto another system
#ssh root@192.168.12.154
b)
Clone
#git clone root@192.168.12.164:projects/myproject.git
#cd myproject
1)
First setup the bare remote repository:
===============================
a)
ssh to remote system
#ssh root@192.168.12.164
b)
Create a new dir
#cd /root/projects/
#mkdir myproject.git
c)
Goto to new dir
#cd myproject.git
d)
Run git init
#git init --bare
e)
For serve via HTTP
#git update-server-info
2)
On local machine:
================
a)
Goto your project dir
#cd myproject
b)
Run git init
#git init
c)
Add all files to git
#git add *
d)
Commit
#git commit -m "My initial commit message"
e)
Add remote bare repo
#git remote add origin root@192.168.12.164:projects/myproject.git
f)
Push changes to remote bare repo
#git push -u origin master
3)
Clone from remote bare repository
============================
a)
Goto another system
#ssh root@192.168.12.154
b)
Clone
#git clone root@192.168.12.164:projects/myproject.git
#cd myproject
1)
ReplyDeleteFirst setup the bare remote repository:
===================================
ssh root@192.168.12.164
cd /root/projects/
mkdir myproject.git
cd myproject.git
git init --bare
git update-server-info
2)
On local machine:
=================
cd myproject
git init
git add *
git commit -m "My initial commit message"
git remote add origin root@192.168.12.164:projects/myproject.git
git push -u origin master
3)
Clone from remote bare repository
===============================
a)
ssh root@192.168.12.154
git clone root@192.168.12.164:projects/myproject.git
cd myproject
What is a bare git repo
ReplyDeletehttp://www.saintsjd.com/2011/01/what-is-a-bare-git-repository/
http://www.civicactions.com/blog/2010/may/25/how_set_svn_repository_7_simple_steps
ReplyDeletessh to remote bare repo server
ReplyDelete------------------------------
#ssh -p 2222 saju@myserver.org
Specify location of bare repo on Local system
---------------------------------------------
#git remote add origin ssh://saju@myserver.org:2222/~/repos/src.git
Push changes from bare repo to Local System
--------------------------------------------
#git push -u origin master
Clone from bare repo
---------------------
#git clone ssh://saju@myserver.org:2222/~/repos/src.git