Here are two different questions but I think they are related.
-
When using Git, how do I find which changes I have committed locally, but haven’t yet pushed to a remote branch? I’m looking for something similar to the Mercurial command
hg outgoing. -
When using Git, how do I find what changes a remote branch has prior to doing a pull? I’m looking for something similar to the Mercurial command
hg incoming.
For the second: is there a way to see what is available and then cherry-pick the changes I want to pull?
Git can’t send that kind of information over the network, like Hg can. But you can run
git fetch(which is more likehg pullthanhg fetch) to fetch new commits from your remote servers.So, if you have a branch called
masterand a remote calledorigin, after runninggit fetch, you should also have a branch calledorigin/master. You can then get thegit logof all commits thatmasterneeds to be a superset oforigin/masterby doinggit log master..origin/master. Invert those two to get the opposite.A friend of mine, David Dollar, has created a couple of git shell scripts to simulate
hg incoming/outgoing. You can find them at http://github.com/ddollar/git-utils.