Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

mercurial

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

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

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.

like image 969
Robert Martin Avatar asked Oct 02 '11 05:10

Robert Martin


People also ask

What is outgoing in git?

#git. Mercurial has two nice commands: incoming and outgoing changes. Those commands allow to see the commits which are pushed but not fetched and the commits which are not pushed. By default, thoses commands does not exists in git.

Why use Mercurial?

Mercurial Is Safer For Less Experienced Users With basic Mercurial, you can only change your last commit with “hg commit – amend”. Git also stores every change made for 30 days in reflog. For example, you can modify the commit message of the latest commit, and revert it for 30 days.


1 Answers

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

like image 141
adl Avatar answered Sep 23 '22 15:09

adl