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



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

是否有一种从SVN导入到Git的方法,包括SVN复制/重命名之后的修订历史记录?

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.

最新更新