以下适用于你的第二个问题,如何找到branchA
之间的差异和当地的当前版本的master
。您想在git log
上使用'double dot'语法来查看branchA
中不在master
中的所有提交。即:
git log master..branchA
每git log
手册页:
SYNOPSIS
git log [<options>] [<since>..<until>] [[--] <path>...]
...
<since>..<until>
Show only commits between the named two commits. When either <since> or <until> is omitted, it defaults to HEAD, i.e. the tip of the current branch.
For a more complete list of ways to spell <since> and <until>, see gitrevisions(7).
如果你想看到在任一master
或branchA
提交,但不同时,你可以使用“三联点”语法:
git log master...branchA
最后,您可以使用完全相同的语法与git diff
,即git diff master..branchA
和git diff master...branchA
,respectivel年。
另外,如果您有branchA
已签出,则甚至不需要将其指定为<until>
。 Git会承担HEAD
如果它不指定,所以这两个命令集是等价的:
git checkout branchA
git log master..
和
git log master..branchA
这不起作用。也许是因为我已经融入了主人,但我看到其他人所做的更改。 – user1491250 2012-08-01 11:12:22