Skip to content

Instantly share code, notes, and snippets.

@cbess
Created September 26, 2011 00:04
Show Gist options
  • Save cbess/1241345 to your computer and use it in GitHub Desktop.
Save cbess/1241345 to your computer and use it in GitHub Desktop.
Converts svn repo to git then pushes it to git remote repo
#!/bin/bash
# Created by Christopher Bess
# svn2git (https://github.com/nirvdrum/svn2git) helper script
# working directory (holds local git repos)
DIR=tmp
# the svn repo to convert
SVN_URL=https://svn.example.com/example
# the url to the git repo
GIT_URL=user@example.com:git/example.git
# create working dir
rm -rf ${DIR}
mkdir ${DIR} && cd ${DIR}
# perform svn2git magic
svn2git ${SVN_URL}
# push git repo to remote
git remote add origin ${GIT_URL}
git push --all
git push --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment