Migrating SVN repository to GitHub (or any git hosting provider or server)
Sun, 02 April 2017
migrate.sh
# Usage:
# $ ./migrate.sh my-repo-name
REPONAME="$1"
LOCALURL="file:///the/location/to/svn/$REPONAME"
GITHUB_USERNAME="my-username"
if [ "$REPONAME" == "" ]; then
echo "Usage: "
echo " $0 {reponame}"
exit
fi
echo $LOCALURL
git svn clone $LOCALURL $REPONAME
cd "./$REPONAME"
git svn show-ignore > .gitignore
echo ".svn" >> .gitignore
git add . && git commit -m "Add .gitignore file"
git remote add origin ssh://git@github.com/$GITHUB_USERNAME/$REPONAME.git
git push origin master