Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
docs:git:importing_an_svn_repository [2009/10/19 21:07] – billh | docs:git:importing_an_svn_repository [2010/09/20 10:09] (current) – billh | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== importing an svn repository ====== | ====== importing an svn repository ====== | ||
- | To get in the right frame of mind, don't think of exporting your entire svn repository, but rather export project by project. | ||
+ | ===== using git while keeping an svn repo intact ===== | ||
- create a text file somewhere (~/ | - create a text file somewhere (~/ | ||
jdoe = John Doe < | jdoe = John Doe < | ||
</ | </ | ||
- | - create a temporary | + | - create a project directory, and change to it< |
- | mkdir myproject_tmp | + | mkdir myproject.git |
- | cd myproject_tmp | + | cd myproject.git |
</ | </ | ||
- initialize an empty git repository< | - initialize an empty git repository< | ||
- | git svn init http:// | + | git svn init -s http:// |
</ | </ | ||
+ | * note the -s flag sets the default svn structure for /branches /tags /trunk; if this isn't how your repo is set up, you can use the -T -b -t flags | ||
- set up the user file for mapping< | - set up the user file for mapping< | ||
git config svn.authorsfile ~/ | git config svn.authorsfile ~/ | ||
Line 18: | Line 19: | ||
git svn fetch | git svn fetch | ||
</ | </ | ||
- | - change up one directory, and clone this newly created repository | + | - sync with svn (like running |
- | cd .. | + | git svn rebase |
- | git clone myproject_tmp myproject | + | |
</ | </ | ||
- | - the myproject_tmp directory can now be removed, and the origin remote< | + | - use the master branch to push to svn, and create git only branches for your local development |
- | rm -Rf myproject_tmp | + | - when you have a commit on the master branch ready to push to svn, do this< |
- | cd myproject | + | git svn dcommit |
- | git remote rm origin | + | |
</ | </ | ||
+ | - since it takes so long to pull full svn history into a git repo, you may want to do this once and then set up a git repo that others can clone, if other users want to use git on a large project | ||
+ | |||
+ | ===== See Also ===== | ||
+ | * [[converting an svn project to git]] | ||
===== External Links ===== | ===== External Links ===== | ||
* http:// | * http:// |