-
Create the directory for git worktrees:
mkdir repo_name cd repo_name
-
Init a repo:
git svn init https://path/to/svn/repo_name --username=<username> --trunk=branches/main_branch main_branch
-
Edit
repo_name/main_branch/.git/config
so that it contains something like:[svn-remote "svn"] url = "https://path/to/svn/repo_name" fetch = "branches/main_branch:refs/remotes/svn/main_branch"
Add more
fetch
keys to fetch more branches -
Inspect the SVN log to find a first revision:
svn log https://path/to/svn/repo_name -l <max-depth>
-
Fetch that revision:
git svn fetch -r<revision>
-
Fetch all newer revisions:
git svn fetch
- Delete
.git/refs/remotes/svn
. - Delete
.git/svn
- Run
git svn fetch -r<revision>
. - Run
git svn fetch
. - Rebase local branches.