如何将一个分支与默认分支进行比较 [英] How do I diff one branch with my default branch

查看:61
本文介绍了如何将一个分支与默认分支进行比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我切换到本地存储库上的一个分支,注意到它给了我显示x个文件已更新的消息.这让我感到惊讶,因为我不知道该分支有什么区别.如何将该分支与默认分支进行比较以查看发生了什么变化?

I switched to a branch on my local repo and noticed it gave me message showing x files updated. This surprised me as I didn't know there were any differences on that branch. How do I compare that branch with the default branch to see what has changed?

推荐答案

使用hg diff -r BRANCH1:BRANCH2,其中BRANCH1和BRANCH2是分支的名称.这将向您显示两个分支头之间的差异.

Use hg diff -r BRANCH1:BRANCH2, where BRANCH1 and BRANCH2 are the names of the branches. This will show you the differences between the heads of the two branches.

您收到有关"x个文件已更新"的消息,因为原始分支上的文件已更改,而未必一定是因为另一个分支上的文件已更改. Mercurial向您显示两个分支中已更改文件集的并集.

You got the message about "x files updated" because there were files changed on the original branch, not necessarily because there were files changed on the other branch. Mercurial shows you the union of the sets of changed files from both branches.

这篇关于如何将一个分支与默认分支进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆