public
Last active — forked from markjaquith/gist:2628225

Script to sync wxWidgets SVN to GitHub

  • Download Gist
gistfile1.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/bin/bash
 
# Intial git svn clone:
# git svn clone --prefix=svn/ -A ~/.svn2git/authors -s https://svn.wxwidgets.org/svn/wx/wxWidgets wxWidgets
 
cd ~/svn-git-mirrors/wxWidgets;
 
if [ -f .sync-running-wxWidgets ]; then exit 1; fi;
 
touch .sync-running-wxWidgets
 
# Pull all updates down from SVN first (the meat of the sync).
git svn fetch
git svn rebase
 
# Create a git tag for each SVN tag if it doesn't already exist.
git for-each-ref refs/remotes/svn/tags | cut -d / -f 5- | while read ref; do
git tag -f $ref refs/remotes/svn/tags/$ref;
done;
 
# Create a local git branch for all SVN branches we really care about.
svn list https://svn.wxwidgets.org/svn/wx/wxWidgets/branches | grep -oE '[^/]*' | while read branch; do
git branch -f $branch remotes/svn/$branch;
done;
 
git push --mirror git@github.com:wxWidgets/wxWidgets.git;
 
rm .sync-running-wxWidgets

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.