git outgoing/incoming changes
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. But it's really simple to use git's aliases to do it :
Outgoing
git log --pretty=oneline --abbrev-commit --graph @{u}..
Incoming
git fetch && git log --pretty=oneline --abbrev-commit --graph ..@{u}
Add this to your alias section in ~/.gitconfig if you want :
out = log --pretty=oneline --abbrev-commit --graph @{u}..
in = !git fetch && git log --pretty=oneline --abbrev-commit --graph ..@{u}
Written by Yves Brissaud
Related protips
4 Responses
These are a bit mixed up... your "Incoming" command should have the "git fetch" instead of "Outgoing".. but in the last section for .gitconfig, you have the fetch on the right one but the log commands are backwards (out should be @{u}.. and in should be ..@{u})
Thanks for pointing out the errors. I've edited the protip to fix it.
Little add for outgoing stat
git log --pretty=oneline --abbrev-commit --graph @{u}.. --stat
I don't really use --stat but for the outgoing it's pretty nice and help to see what changed. Thanks.