Custom Search

Friday, June 14, 2013

Git setting up bare remote repository in VPN network

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

4 comments:

  1. 1)
    First 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

    ReplyDelete
  2. What is a bare git repo
    http://www.saintsjd.com/2011/01/what-is-a-bare-git-repository/

    ReplyDelete
  3. http://www.civicactions.com/blog/2010/may/25/how_set_svn_repository_7_simple_steps

    ReplyDelete
  4. ssh to remote bare repo server
    ------------------------------
    #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

    ReplyDelete