Skip to content

Instantly share code, notes, and snippets.

@tollmanz
Created November 24, 2012 03:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tollmanz/4138257 to your computer and use it in GitHub Desktop.
Save tollmanz/4138257 to your computer and use it in GitHub Desktop.
Easy sync for git and svn repo
# -s assumes normal branches/tags/trunk structure
git svn clone -s http://svn.my.little.repo.com
# Add the git repo
git remote add git-repo git@github.com:tollmanz/my-little-repo.git
# Pull in the git remote
git fetch git-repo
# Create new tracking branch
git checkout --track -b github git-repo/master
# Check out master, which is the SVN repo
git checkout master
# Merge the git master branch to the SVN repo
git merge github
# Commit the changes
git commit -a
# Commit the changes from git
git svn dcommit
# To tag a release (as in create a new folder in the SVN repo's "tags" directory)
git svn tag tag-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment