Skip to content

Instantly share code, notes, and snippets.

@markwillis82
Last active December 19, 2015 11:28
Show Gist options
  • Save markwillis82/5947412 to your computer and use it in GitHub Desktop.
Save markwillis82/5947412 to your computer and use it in GitHub Desktop.
Subversion to git conversion
echo "git - svn conversion"
git svn clone file:///repos/dev.server --authors-file=users.txt --no-metadata -s devGitRepo
echo "Clean up branches"
cd bhlive.git/
git remote add origin <add remote repo url>
git for-each-ref refs/remotes | cut -d / -f 3- | grep -v @ | while read branchname; do git branch "$branchname" "refs/remotes/$branchname"; git branch -r -d "$branchname"; done
echo "push to BitBucket"
git push origin --all
echo "Checkout svn repo"
svn co file:///repos/dev.server dev.repo
echo "Create users file"
svn log --xml dev.bhlive.repo | grep -P "^<author" | sort -u | perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt
echo "Map users to bitbucket accounts"
cat users.txt
# chris.cherrett = Chris Cherrett <chris.cherrett@adi.do>
# thomas.stradling = Thomas Stradling <thomas.stradling@adi.do>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment