tech life

corperate with svn using git

June 1, 2017

migration prepare


cd ~/GitMigration

java -jar ~/svn-migration-scripts.jar authors <svn-repo> > authors.txt

if the number of authors is small,you can create the authors manually.



git svn clone --trunk=/STORAGE_PRODUCT --no-metadata --authors-file=authors.txt --username=baojianguo objdev1

java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git

java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git --force

synchronzie with svn repo using git

ref : when svn add author,we should change the authors.txt file!

git svn fetch

java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar sync-rebase

java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git --force

create git remote repo


routine workflow

git fetch --all; # fetch from the git repo git reset --hard origin/master; git log; git status; git log; git svn fetch; # from the svn repo java -Dfile.encoding=utf-8 -jar ../../svn-migration-scripts.jar sync-rebase; git mergetool; # config meld as mergetool git rebase --continue; git log; git push -f origin master; #then test on git code git fetch --all; git reset --hard origin/master; git svn fetch; java -Dfile.encoding=utf-8 -jar ../../svn-migration-scripts.jar sync-rebase; git svn dcommit; git push -f origin master;