docs:git:converting_an_svn_project_to_git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:git:converting_an_svn_project_to_git [2010/09/20 12:23] billhdocs: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/users.txt) to map the svn users to git users<code>+  - create a text file somewhere (~/.git-svn-users) to map the svn users to git users<code>
 jdoe = John Doe <jdoe@example.com> jdoe = John Doe <jdoe@example.com>
 </code> </code>
   - alter your global config file (~/.gitconfig) to use this user mappings file<code>   - alter your global config file (~/.gitconfig) to use this user mappings file<code>
-git config --global svn.authorsfile ~/Desktop/users.txt+git config --global svn.authorsfile ~/.git-svn-users
 </code> </code>
  
Line 30: Line 30:
 </code> </code>
   - (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:<code bash>
 +for file in {project1,project2,project3}
 +do
 +        git svn clone file:///path/to/svn/repo/project/${file} ${file}_tmp --no-metadata \
 +        && git clone --bare ${file}_tmp /path/to/git/shares/${file}.git \
 +        && rm -Rf ${file}_tmp/ \
 +        && git clone /path/to/git/shares/${file}.git/
 +done
 +</code>
  
 ===== old method ===== ===== old method =====
  • docs/git/converting_an_svn_project_to_git.1285007022.txt.gz
  • Last modified: 2010/09/20 12:23
  • by billh