SVN分支比较

发布于 2024-08-12 04:59:31 字数 44 浏览 4 评论 0原文

如何将一个分支与另一个分支进行比较?我想将分支与主干中的最新版本进行比较。

How do I compare one branch with another? I want to compare a branch with the latest revision in trunk.

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

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

发布评论

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

评论(7

划一舟意中人 2024-08-19 04:59:31

您可以从以下内容开始:(

svn diff http://REPOS/trunk http://REPOS/branches/B

其中 http://REPOS 是您的存储库路径,包括 trunkbranches 的父级。)

这将打印大量文本,包括所有文本更改,但不包括二进制更改,除非说明它们发生的地点和时间。

You could start with:

svn diff http://REPOS/trunk http://REPOS/branches/B

(Where http://REPOS is your repository path including the parents of trunk and branches.)

This will print a large quantity of text, including all the textual changes but not the binary changes except to say where and when they occurred.

拿命拼未来 2024-08-19 04:59:31

如果您只是寻找高级文件的不同之处并且不想查看所有内容,请使用:

svn diff ^/trunk ^/branches/dev --summarize

(这比较了 trunk 和开发分支)

If you are just looking for high level of what files are different and do not want to see all the contents, use:

svn diff ^/trunk ^/branches/dev --summarize

(This compares trunk and dev branch)

探春 2024-08-19 04:59:31

我通常将两个分支(或分支和主干)签入目录。
然后我使用 Kompare 或类似的图形工具(取决于您的偏好、操作系统……)。
当我需要执行复杂的合并时,这对我来说非常有帮助。

I usually check out the two branches (or the branch and the trunk) into directories.
Then I use a graphical tool like Kompare or similar (depending on your preferences, operating system,...).
This is really helpful for me when I need to perform complex merges.

友欢 2024-08-19 04:59:31

由于缺乏声誉,我无法将其添加为针对现有答案的评论,因此我必须将其添加为单独的答案。

对我来说,svn diff 的一个有用选项是 --ignore-properties。我的两个分支最终以相同的代码方式结束,但具有不同的合并历史。

使用 --ignore-properties 让我可以向自己证明情况确实如此,而无需费力地进行大量的“svn:mergeinfo”属性更改。

As lack of reputation won't let me add this as a comment against an existing answer, I'm having to add it as a separate one.

A useful option to svn diff for me was --ignore-properties. My two branches had ended up identical code wise, but with different merge histories.

Using --ignore-properties allowed me to prove to myself that this was the case, without wading through the large quantity of "svn:mergeinfo" property changes.

森林迷了鹿 2024-08-19 04:59:31

感谢您提供的信息,我会添加一些内容来提高差异结果的可读性。如果您使用:
svn diff svn://url:9090/branches/PRD_0002 svn://url:9090/branches/TST_0003 >svn_diff_filename.txt

您可以使用:
findstr "Index:" C:\path\svn_diff_filename.txt > svn_diff_file_list.txt

这将为您带来一个有任何差异的文件的可读列表。

Thanks for the info guys, I would add something to improve the readability of the diff results.If you used:
svn diff svn://url:9090/branches/PRD_0002 svn://url:9090/branches/TST_0003 >svn_diff_filename.txt

You can use:
findstr "Index:" C:\path\svn_diff_filename.txt >svn_diff_file_list.txt

That will bring you a readable list of files that have any differences.

往事风中埋 2024-08-19 04:59:31

这是Murray Cumming 的帖子 其中描述了非显而易见的过程:

  • 发现修订号:您需要知道每个分支中最新版本的修订号。看起来 svn log 是唯一的方法。
  • cd 进入分支目录之一,例如 trunk。
  • 向 svn diff 命令提供修订号:svn diff -r123:145

Here's a post from Murray Cumming which describes the non-obvious process:

  • Discover the revision numbers: You need to know the revision numbers of the latest versions in each of the branches. It looks like svn log is the only way to do that.
  • cd into one of the branch directories, such as trunk.
  • Supply the revision numbers to the svn diff command: svn diff -r123:145
も星光 2024-08-19 04:59:31

要区分分支的两个修订版:

svn diff -r rLATEST:rOLD

使用 svn log 获取不同的修订版。使用svn log -l 5可以限制日志中的修订数量。仅显示最后 5 个修订。

To diff between two revisions of a branch:

svn diff -r rLATEST:rOLD

Use svn log to get the different revisions. Use can limit the number of revisions in the log using svn log -l 5. only the last 5 revisions will be shown.

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