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

发布于 2024-12-02 02:15:30 字数 404 浏览 0 评论 0原文

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

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

I recently moved an SVN repository into Git (following http://www.jonmaddox.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-a-git-repository/) but found a bit of a limitation - some of the files being imported have a long history prior to a SVN copy, but doing a git log --follow on any of these files only gives the history after the copy.

Is there a way of importing from SVN to Git that includes a revision history that follows SVN Copy/Rename?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丢了幸福的猪 2024-12-09 02:15:30

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.

Git doesn't store info about copies explicitly, so it's not a matter of how you import it, you have to tell it to detect them when you do the log command if you want it. From the git-log man page:

-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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文