corperate with svn using git
Published · Updated
migration prepare
ref: https://www.atlassian.com/git/tutorials/migrating-prepare
download migration script
mkdir ~/GitMigration
Extract the author information:
cd ~/GitMigrationjava -jar ~/svn-migration-scripts.jar authors <svn-repo> > authors.txtif the number of authors is small,you can create the authors manually.
convert
ref: https://www.atlassian.com/git/tutorials/migrating-convert
git svn clone --trunk=/STORAGE_PRODUCT --no-metadata --authors-file=authors.txt --username=baojianguo http://192.168.88.85/svn/ objdev1java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-gitjava -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git --forcesynchronzie with svn repo using git
ref :https://www.atlassian.com/git/tutorials/migrating-synchronize when svn add author,we should change the authors.txt file!
git svn fetchjava -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar sync-rebasejava -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git --forcecreate git remote repo
omit ## 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;