Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
docs:git:converting_an_svn_project_to_git [2010/09/20 10:29] – created billh | docs:git:converting_an_svn_project_to_git [2013/10/13 11:31] (current) – [set up svn to git user mappings] billh | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== set up svn to git user mappings ===== | ===== set up svn to git user mappings ===== | ||
- | - create a text file somewhere (~/Desktop/ | + | - create a text file somewhere (~/.git-svn-users) to map the svn users to git users< |
jdoe = John Doe < | jdoe = John Doe < | ||
</ | </ | ||
- alter your global config file (~/ | - alter your global config file (~/ | ||
- | git config --global svn.authorsfile ~/Desktop/ | + | git config --global svn.authorsfile ~/.git-svn-users |
</ | </ | ||
Line 13: | Line 13: | ||
- use git svn to clone your svn project to a temporary directory< | - use git svn to clone your svn project to a temporary directory< | ||
git svn clone svn:// | git svn clone svn:// | ||
+ | </ | ||
+ | * UPDATE - it seems as if the error below could be related to Tortoise and/or the TortoiseSVN cache running at the same time (we are writing these conversions directly into an svn working copy) | ||
+ | * if you get an error like the following, just ctrl-c the operation, delete the temporary directory, and try it again< | ||
+ | 20592274 [main] perl 3584 C: | ||
+ | 20597997 [main] perl 3572 fork: child 3584 - died waiting for dll loading, errno 11 | ||
</ | </ | ||
- cd into myproject_tmp, | - cd into myproject_tmp, | ||
Line 25: | Line 30: | ||
</ | </ | ||
- (optional) compare your current svn working copy with the final git working copy, then remove the project from svn | - (optional) compare your current svn working copy with the final git working copy, then remove the project from svn | ||
+ | |||
+ | If you are lucky (no errors), steps 1-5 can be automated with a simple bash loop:< | ||
+ | for file in {project1, | ||
+ | do | ||
+ | git svn clone file:/// | ||
+ | && git clone --bare ${file}_tmp / | ||
+ | && rm -Rf ${file}_tmp/ | ||
+ | && git clone / | ||
+ | done | ||
+ | </ | ||
===== old method ===== | ===== old method ===== | ||
Line 65: | Line 80: | ||
</ | </ | ||
- you should also consider that although svn allows empty directories as part of the repo, git does not; we usually fix this by adding empty files named .emptydir in any directory that needs it | - you should also consider that although svn allows empty directories as part of the repo, git does not; we usually fix this by adding empty files named .emptydir in any directory that needs it | ||
+ | |||
+ | ===== See Also ===== | ||
+ | * [[importing an svn repository]] | ||
+ |