I just used the instructions in this article by John Albin to archive an old svn project on my private machine.
A shell summary (see the John’s article for details):
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt vim authors-transform.txt # Make changes git svn clone [SVN repo URL] --no-metadata -A authors-transform.txt --stdlayout ~/temp ~/temp git svn show-ignore > .gitignore git add .gitignore git commit -m 'Convert svn:ignore properties to .gitignore.' git init --bare ~/new-bare.git ~/new-bare.git git symbolic-ref HEAD refs/heads/trunk ~/temp git remote add bare ~/new-bare.git git config remote.bare.push 'refs/remotes/*:refs/heads/*' git push bare ~ rm -rf ~/temp ~/new-bare.git git branch -m trunk master ~/new-bare.git git for-each-ref --format='%(refname)' refs/heads/tags | cut -d / -f 4 | ref git tag "$ref" "refs/heads/tags/$ref"; git branch -D "tags/$ref";
John has also put all this into a number of scripts published on GitHub.
Recent Comments