Skip to content

Instantly share code, notes, and snippets.

@scribu
Forked from tierra/gist:3061041
Created October 17, 2012 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scribu/3906950 to your computer and use it in GitHub Desktop.
Save scribu/3906950 to your computer and use it in GitHub Desktop.
Script to sync wxWidgets SVN to GitHub
#!/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 rebase
# Create a git tag for each SVN tag if it doesn't already exist.
git for-each-ref refs/remotes/tags | cut -d / -f 4 | while read ref; do
git tag -f $ref refs/remotes/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment