Created
October 5, 2009 19:59
-
-
Save jabley/202391 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat svn2git.sh | |
#! /bin/sh | |
# Simple script to mirror an existing SVN repository as a git repository. | |
# Full project history will be imported | |
# | |
# Usage: | |
# svn2git.sh name-of-module | |
# name-of-module - the name of the GIT repository that we wish to create | |
# svn/module/path - the optional SVN path of the module being mirrored. | |
# Defaults to the name of the GIT repository being created | |
if [ -z $1 ] ; then | |
echo "Usage: $0 module-name [svn/module/path]" | |
exit 1 | |
fi | |
module_name=$1 | |
if [ -z $2 ] ; then | |
svn_path=$module_name | |
else | |
svn_path=$2 | |
fi | |
mkdir $module_name.git | |
cd $module_name.git | |
git --bare init | |
git --bare svn init -s svn://svn.example.com/$svn_path | |
git --bare svn fetch --all | |
git --bare update-server-info | |
cd .. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment