gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 13:46:17 26 4
gpt4 key购买 nike

我最近将一个 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com