Load an SVN repo to a git repo with history

by
  1. git config --global user.name "<your full name>"
  2. git config --global user.email "<your email@domain.com>"
  3. git config --global push.default tracking
  4. git config --global color.ui auto
  5. git config --global diff.mnemonicprefix true
  6. git config --global core.pager less
  7. git config –global branch.autosetupmerge = true
  8. git config –global alias.ci = commit
  9. git config –global alias.co = checkout
  10. git config –global alias.st = status
  11. git config –global alias.lg = log –name-status –decorate
  12. git config –global alias.df = diff –word-diff
  13. create a ~/svnusers.txt file
    • username1 = First1 Last1 <fLast@domain.com>
    • username2 = First2 Last2 <fLast2@domain.com
  14. mkdir proj/projname_TMP
  15. cd proj/projname_TMP
  16. git-svn init http://svnrepo.url
  17. git config svn.authorsfile ~/svnusers.txt
  18. git svn fetch
  19. git svn rebase
  20. git gc
  21. cd ..
  22. mkdir projname
  23. git clone projname_TMP projname
  24. cd projname
  25. git remote add origin username@domain.com:proj_repo.git
  26. git config branch.master.remote origin
  27. git config branch.master.merge refs/heads/master

caveats

  • Empty directories are not recorded in Git, you must createa  token (even empty) file
  • svn:ignore is not available in git, instead you need to use .gitignore
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.