Skip to content

Instantly share code, notes, and snippets.

@childnode
Created September 1, 2015 06:49
Show Gist options
  • Save childnode/979812d69a3f266baede to your computer and use it in GitHub Desktop.
Save childnode/979812d69a3f266baede to your computer and use it in GitHub Desktop.
git svn rebase with branches
mkdir svn
mkdir git
svnadmin create --pre-1.4-compatible svn
svn checkout file:///%CD:\=/%/svn svninit
cd svninit
mkdir trunk branches tags
svn add trunk branches tags
svn commit -m "init"
cd ..
svn checkout file:///%CD:\=/%/svn/trunk svnco
cd svnco
touch trunk/1.txt
svn add 1.txt
svn commit -m "first commit"
cd ../svninit
svn copy trunk branches/v1
svn commit -m "first branch"
cd ..
git svn clone -s file:///%CD:\=/%/svn svnco.git
cd svnco.git
touch 1.git.txt
git add .
git commit -m "git change on svn clone"
cd ../svnco
touch 2.txt
svn add 2.txt
svn commit -m "second svn commit for git svn rebase"
cd ../svninit
svn copy trunk branches/v2
svn commit -m "second branch"
cd ../svnco.git
git svn rebase --fetch-all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment