hg out (hg out) 或 hg incoming (hg in) 的 git 等价物是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7624790/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 11:58:45  来源:igfitidea点击:

What is the git equivalent of of hg outgoing (hg out) or hg incoming (hg in)?

gitmercurial

提问by Robert Martin

Possible Duplicate:
How can I see incoming commits in git?

可能的重复:
如何在 git 中查看传入的提交?

What is the git equivalent of of "hg outgoing" or "hg incoming"?

“hg out”或“hgincoming”的git等价物是什么?

In Mercurial, hg outgoinglists the changesets that are newer than what's on the server and will be sent if I were to do hg push. Same in reverse for hg incomingand hg pull.

在 Mercurial 中,hg outgoing列出比服务器上更新的变更集,如果我要这样做,将发送hg pushhg incoming和反之亦然hg pull

回答by adl

If you want to list commits that are on branch Bbut not on branch A, do git log A..B.

如果要列出在 branch 上B但不在 branch上的提交A,请执行git log A..B.

If you want to list commits that are on your local branch dev, but not the the remote branch origin/dev, do:

如果要列出本地分支上的提交dev,而不是远程分支上的提交origin/dev,请执行以下操作:

git fetch origin             # Update origin/dev if needed
git log origin/dev..dev

If you want to list commits that are on the remote branch, but not on the local branch, simply do the converse:

如果你想列出远程分支上的提交,而不是本地分支上的提交,只需执行相反的操作:

git fetch origin             # Update origin/dev if needed
git log dev..origin/dev

Note: you might find it easier to compare branches graphically using gitk origin origin/dev

注意:您可能会发现使用图形方式比较分支更容易gitk origin origin/dev