Created
November 24, 2012 03:41
-
-
Save tollmanz/4138257 to your computer and use it in GitHub Desktop.
Easy sync for git and svn repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -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