Starting with Git 1.7.0, there is a special syntax that allows you to generically refer to the upstream branch: @{u}
or @{upstream}
.
To mimic hg incoming
:
git log ..@{u}
To mimic hg outgoing
:
git log @{u}..
I use the following incoming
and outgoing
aliases to make the above easier to use:
git config --global alias.incoming '!git remote update -p; git log ..@{u}'
git config --global alias.outgoing 'log @{u}..'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…