Welcome, Guest :: Blog Home | Login | Register

Article
Remote Git Repository Setup

2009-08-23 20:14:59 Tags: git linux

I've been doing a lot of work moving from SVN to Git for source code version control. The following is a quick and easy how-to for setting up a remote git repository. This example shows how to import an existing SVN repo into a new git repo.

1) [Local machine] Export clean code base from remote SVN repository:

Code:
cd /var/git/
svn export http://svn.domain.com/trunk myapp.git
cd myapp.git
git init
git add .
git commit -m "initial import"


2) [Remote server]: Make remote git repository:

Code:
ssh user@ipaddress
mkdir /var/git/myapp.git && cd /var/git/myapp.git
git --bare init


3) [Local machine] Add/push local repo to remote repo:

Code:
git remote add origin user@ipaddress:/var/git/myapp.git
git push origin master


4) Give out git repo info to developers:

Code:
git clone user@ipaddress:/var/git/myapp.git


That's all that's required for source code versioning via Git. Each developer can now clone from the master branch of the remote server (see step 4) and go to work! More on how to commit revisions soon.

~Stephen

Comments:

There are no comments.

Please login or register to post comment.