Instructions:
1. Check out the source tree from SVN server with svn command:
1
|
|
2. Generate an users.txt with the command:
1 2 |
|
and following the formatting:
1 2 |
|
NOTE: You can try the script to generate authors list automatically: https://gist.github.com/lifuzu/9081923#file-findauthors-sh
3. Once the users.txt is ready, then checkout the source tree again with the command ‘git svn clone’:
1 2 |
|
4. To move the tags to be proper Git tags, run:
1
|
|
5. To move the rest of the references under refs/remotes to be local branches:
1
|
|
6. Adding the git server as a remote:
1
|
|
7. Push all your branches and tags to go up:
1 2 |
|
8. Update the changes from SVN (before you update, please cleanup your local workspace)
1 2 3 4 5 |
|
NOTE: Sometimes when you run git svn fetch
:
1 2 |
|
Then you need to run:
1 2 |
|
9. Then check them into GIT
1 2 |
|
10. If you have a temporary migration branch you modified something on that, then you need rebase the changes on master to migration:
1 2 |
|
11. Finally, you need merge the changes on migration, fast forward, since you have rebased.
1 2 |
|
That is it!
Reference:
- http://git-scm.com/book/en/Git-and-Other-Systems-Migrating-to-Git
- http://git-scm.com/book/ch3-6.html
- http://stackoverflow.com/questions/16565991/keep-svn-repository-in-sync-with-git-one
- http://stackoverflow.com/questions/5241898/is-a-bidrectional-git-svn-sync-both-writable-possible
Written with StackEdit.