开发者

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

开发者 https://www.devze.com 2023-04-10 05:24 出处:网络
This question already has answers here: Closed 10 years ago. Possible Duplicate: How can I see incoming commits in git?
This question already has answers here: Closed 10 years ago.

Possible Duplicate:

How can I see incoming commits in git?

What is the git equivalent of of "hg outgoing" or "hg inco开发者_JAVA技巧ming"?

In Mercurial, hg outgoing lists 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 incoming and hg pull.


If you want to list commits that are on branch B but not on branch A, do 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:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号