Create a users file (i.e. users.txt
) for mapping SVN users to GIT:
user1 = First Last Name <[email protected]>
user2 = First Last Name <[email protected]>
...
SVN will stop if it finds a missing SVN user not in the file. But after that you can update the file and pick-up where you left off.
Now pull the SVN data from the reop:
git svn clone --stdlayout --no-metadata -A users.txt svn://hostname/path dest_dir-tmp
A this command will create a new git repo in dest_dir-tmp
and start pulling the SVN repo.
If a user name is not found, update your users.txt
file then:
cd dest_dir
git svn fetch
When completed, git will checkout the SVN trunk
into a new branch. Any other branches are setup as remotes. You can view the other SVN branches with:
git branch -r
If you want to keep other remote branches in your repo, you want to create a local branch for each one manually. If you don't do this, the branches won't get cloned in the final step.
git checkout -b local_branch remote_branch
# it's ok if local_branch and remote_branch are the same name
Finally, clone your GIT-SVN repo into a clean git repo:
git clone dest_dir-tmp dest_dir
rm -rf dest_dir-tmp