1

I am converting a PHP application that is stored in a SVN repository to an MVC framework and I would like to store the new code in a GIT repository.

Most of what I am copying from the old code is Models that we have created over time. The commit history is a very important part of our development process, but to keep the repository simple, I only want the history for those files, not for the entire repository.

Is there a way to export the history of a single file (or a handful of files out of hundreds) from SVN to GIT?

Example:

copy-with-history /svn/project/inc/classes/*.mo.php /git/project2/app/Classes/Models/*.php
kan
  • 28,279
  • 7
  • 71
  • 101
yakatz
  • 2,142
  • 1
  • 18
  • 47

1 Answers1

0

There is --ignore-paths= argument you could specify to the git svn clone command. The tricky part is to compose a regular expression which includes only that you need. You know your repo better, maybe you could compose a simple list of ignores.

kan
  • 28,279
  • 7
  • 71
  • 101
  • Can I run that multiple times to merge more files into the repository? – yakatz Apr 24 '13 at 00:16
  • @yakatz Sounds strange. Normally you should do `clone` once. Why do you want it multiple times? There is `reset` command which allow to re-fetch commits, but it requires a lot of history rewriting. – kan Apr 24 '13 at 06:44