Scripts for migrating SVN repositories to Git.
- Any SVN layout:
./export-all [--nostdlayout] [-n|--dry-run] <SVN_URL> <GIT_REMOTE_URL> <DIR_NAME> - Batch from
svn-urls.txt:./transfer <github-username> <github-token-or-password>
export-all– Clone an SVN repo (defaultgit svn --stdlayout, or plaingit svn clonewith--nostdlayout), add the provided Git remote, pushmaster, and move the result into~/repositories/github/<DIR_NAME>. Supports dry-run via-n/--dry-run.transfer– Loops over URLs insvn-urls.txt, recreates GitHub repos viarecreate_repo, and callsexport-allfor each. Args:<username> <password-or-token>.recreate_repo– Deletes and recreates a GitHub repo usingdelete_repoandcreate_repo.create_repo/delete_repo– Ruby helpers that preferGITHUB_TOKENbut also accept<username> <password-or-token>as args.github-import– For each subdirectory, recreates a GitHub repo with a prefix and pushesmain. Args:<username> <password> <prefix> <org-or-user>.update-gitsvn– Rungit svn fetch+git svn rebase, then push. Enable force push viaFORCE_PUSH=1.update-branches– Track missing remote branches (skipsorigin/HEAD), thengit pull --allandgit push --all.update-all– Callupdate-dirfor every repo under a base directory.update-dir– Invokeupdate-gitsvnandupdate-svndcommitfor a single repo.update-svndcommit– Pull Git changes andgit svn dcommitback to SVN.fixit– Cleans stale git reference directories under each repo listed in~/files(destructive; review before use).export-alland other scripts expectgit svnto be installed and reachable.
- Destinations: staging clones go to
~/repositories/staging; final Git copies are placed under~/repositories/github. - Authentication: prefer
GITHUB_TOKENin the environment; fall back to username/password arguments where supported. - Dry runs:
export-allaccepts-n/--dry-runto print actions without executing. - Safety: most scripts use
set -euo pipefail; destructive operations (likerm -rfduring export) run only after successful steps when not in dry-run.
- These scripts should be installed in "bin" under ${HOME}.
- Or they should be installed in your $PATH.