在svn中复制/重命名之前保留修订历史记录 - >混帐

时间:2011-08-31 14:11:14

标签: git svn git-svn

我最近将一个SVN存储库移动到Git中(在http://www.jonmaddox.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-a-git-repository/之后),但发现了一些限制 - 导入的一些文件在SVN复制之前有很长的历史记录,但是做一个git日志 - 按照这些文件中的任何一个仅提供复制后的历史记录。

有没有办法从SVN导入到Git,其中包含SVN复制/重命名后的修订历史记录?

1 个答案:

答案 0 :(得分:1)

Git没有明确地存储有关副本的信息,因此不是如何导入它的问题,如果你需要它,你必须告诉它在你执行log命令时检测它们。从git-log手册页:

-C[<n>]
--find-copies[=<n>]
Detect copies as well as renames. See also --find-copies-harder. If n is specified, 
it has the same meaning as for -M<n>.

--find-copies-harder
For performance reasons, by default, -C option finds copies only if the original file
of the copy was modified in the same changeset. This flag makes the command inspect 
unmodified files as candidates for the source of copy. This is a very expensive 
operation for large projects, so use it with caution. Giving more than one -C option
has the same effect.