- Install Reposurgon: https://gitlab.com/esr/reposurgeon
- Install Git-Filter-Repo (optional): https://github.com/newren/git-filter-repo
The reposurgon tool is the main tool to convert repositories. The documentation is really not that great IMO, but it can be found here:
http://www.catb.org/esr/reposurgeon/repository-editing.html
Follow these instructions:
$ mkdir my_conversion
$ cd my_conversion
$
$ svn checkout $SVN_URL # Good to make a backup
$ mv $MY_REPO my_repo_full_checkout
$
$ mkdir conversion
$ cd conversion
$
$ # Create Repotool make file and fill out the prompts
$ repotool initmake $PROJECT_NAME
> repotool: what VCS do you want to convert from? svn
> repotool: what VCS do you want to convert to? git
> repotool: generating Makefile, some variables in it need to be set.
> repotool: generating a stub options file.
> repotool: generating a stub lift file.
> repotool: generating a stub map file.Edit REMOTE_URL and other fields as you see fit:
EXTRAS =
REMOTE_URL = svn://svn.debian.org/SIEM
CVS_HOST = cvs.sourceforge.net
#CVS_HOST = cvs.savannah.gnu.org
CVS_MODULE = SIEM
#REMOTE_URL = cvs://$(CVS_HOST)/SIEM\#$(CVS_MODULE)
READ_OPTIONS =
#CHECKOUT_OPTIONS = --ignore-externals
DUMPFILTER = cat
VERBOSITY = "set flag progress"
REPOSURGEON = reposurgeon
LOGFILE = conversion.log
# Set and uncomment these if remote access to Subversion needs credentials.
#export RUSERNAME=
#export RPASSWORD=Then, edit the author map in the $PROJECT_NAME.map:
# Author map for SIEM
svnUserName = First Last <[email protected]>
...
You can also fill out the other files that are created. See the documentation that was linked above.
Then, type make:
$ makeThen the repo will be converted.
See the git-filter-repo tools here: https://htmlpreview.github.io/?https://github.com/newren/git-filter-repo/blob/docs/html/git-filter-repo.html
If you have a SVN repository that has large files in it, mirroring can often stop due to disconnections. To get over this:
- Run
makeuntil the mirroring errors out - CD into the mirror directory
- Run
svnsyncmanually:
$ svnsync synchronize --source-username \"uname\" --source-password \"pw\" --steal-lock file:///path/to/where/you/wanna/mirrorYou may need to repeat the svnsync command several times if it stops, but
the synchronize will pick up where it left off.