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

标签 git svn git-svn

我最近将一个 SVN 存储库移到了 Git 中(遵循 http://www.jonmaddox.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-a-git-repository/ )但发现了一些限制 - 一些被导入的文件在 SVN 复制之前有很长的历史,但是执行 git log --follow on这些文件中的任何一个都只提供复制后的历史。

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

最佳答案

Git 不会显式存储有关副本的信息,因此这与您如何导入它无关,如果需要,您必须告诉它在执行日志命令时检测它们。来自 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.

关于git - 在 svn -> git 中复制/重命名之前保留修订历史,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7258213/

相关文章:

Git:如何取消暂存文件更改(新提交)

svn - 错误 : Retrieval of mergeinfo unsupported by 'svn://IP.Address' ?

asp.net - 来自 ASP.NET 的 SVN 信息 : 'Can' t determine the user's config path'

Git:git svn rebase 失败。 RA层请求失败

svn - Git-svn的运行理念?

java - Netbeans - 克隆 bitbucket 存储库的特定分支

linux - 如何在我的家庭网络上访问 git 存储库?

git - 如何从 git 的暂存区中删除一堆文件更改?

linux - 我在 SVN 中四处移动,来回复制文件。现在我不能使用它

git - cygwin 上 svn-git 的命令 git 分支