Skip to content

Instantly share code, notes, and snippets.

@jurgenvinju
Created April 25, 2013 14:27
Show Gist options
  • Save jurgenvinju/5460118 to your computer and use it in GitHub Desktop.
Save jurgenvinju/5460118 to your computer and use it in GitHub Desktop.
Shell script to migrate some SVN repository from Eclipse to github
#! /bin/sh
set -e
repo=$1
mkdir ${repo}
cd ${repo}
echo "Creating repo on github"
curl -u 'jurgenvinju' https://api.github.com/orgs/impulse-org/repos -d "{\"name\":\"${repo}\",\"has_wiki\": false,\"has_issues\": false}"
echo "Loading from Eclipse.org SVN"
svn2git https://dev.eclipse.org/svnroot/technology/org.eclipse.imp/trunk/org.eclipse.${repo} --username jvinju --authors ~/authors.txt --rootistrunk --verbose
echo "Pushing to github"
git remote add origin git@github.com:impulse-org/${repo}.git
git push -u origin master
cd ..
echo "Moving the repo"
svn move https://dev.eclipse.org/svnroot/technology/org.eclipse.imp/trunk/org.eclipse.${repo} https://dev.eclipse.org/svnroot/technology/org.eclipse.imp/trunk/moved_to_github/org.eclipse.${repo} -m "moved to github https://github.com/impulse-org/${repo}"
svn ls https://dev.eclipse.org/svnroot/technology/org.eclipse.imp/trunk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment