Last active
December 19, 2015 11:28
-
-
Save markwillis82/5947412 to your computer and use it in GitHub Desktop.
Subversion to git conversion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[email protected]> | |
# thomas.stradling = Thomas Stradling <[email protected]> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment