如何查看本地存储库头和远程存储库头之间的差异? [英] How to view diff between head of local repository and head of remote repository?

查看:37
本文介绍了如何查看本地存储库头和远程存储库头之间的差异?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在推送到远程存储库之前,我想查看本地存储库的头部和我也推送的存储库的头部之间的综合差异.我知道这样做的最好方法是 hg clone 远程存储库,获取头部的修订版,然后在我的头部和该修订版之间进行差异.但这很耗时.有什么快捷的方法吗?

Before I push to a remote repository, I want to see a consolidated diff between the head of my local repository and the head of the repository I'm pushing too. The best way I know of doing this is to hg clone the remote repository, get the revision of the head, then do a diff between my head and that revision. But this is time-consuming. Is there a quick way?

推荐答案

除了

$ hg outgoing -p

我通常使用的,我想向您指出修订集.这是一种可以与 hg diff(以及允许您指定变更集的所有其他命令)一起使用的查询语言.所以你可以通过

which I normally use, I'll like to point you to revision sets. That is a query language that you can use with hg diff (and all other commands that lets you specify changesets). So you can implement hg outgoing -p by

$ hg log -r "outgoing()" -p

并且您可以使用

$ hg diff -r "p1(first(outgoing()))" -r "last(outgoing())"

最后,远程分支扩展 可以维护有关远程分支的本地信息,这样您就不会不需要使用网络来查找这些信息.它让你使用

Finally, the remotebranch extension can maintain local information about the remote branches so that you don't need to use the network to lookup this information. It lets you use

$ hg log -r "not pushed()"

找到传出的变更集,但速度要快得多,因为不涉及网络往返.

to find the outgoing changesets, but it's much faster since there's no network round trips involved.

这篇关于如何查看本地存储库头和远程存储库头之间的差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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