This guide will demonstrate how to mirror SVN commits over to GIT. Work in progress...
First off, I'll give some credits. I've lifed all this information from various placed on the web.
- http://help.github.com/mac-set-up-git
- http://swik.net/Rails/Robby+on+Rails/git-svn+is+a+gateway+drug/cboew
# Clone an SVN repo with Git
git svn init -s http://svn.yourdomain.com/repos/project_name
cd project_name
# Fetch the SVN branches to the local Git repo
git svn fetch
# Once this is done, you’re local 'master' branch is linked to trunk/.
# Make a new branch for develop & check it out
git checkout -b develop
# Back to master.
git checkout master
# We'll change this to link local 'develop' branch to trunk
git reset --hard production
Now we have Git branches properly mapped to SVN branches. But, our only remote is the SVN repostory.
Either use an existing Git repository, or create a new one. You will need the remote Git URL to add the remote.
git remote add origin git@github.com:guidance/emergencylink.git
"origin" -- Guidance GIT repository for ICE (git@github.com:guidance/emergencylink.git)
Show current branches $ git branch -va
Switch branches $ git checkout master
Pull latest from SVN $ git svn rebase
Push changes to Github: $ git push $ git push origin develop
Merge another branch into the current: $ git merge
Pull latest SVN repository to local git repository: $ git checkout develop // Switch to develop branch $ get svn rebase // Get latest stuff from repository $ git push origin develop // Send code to Github repository