Git图形历史输出

时间:2012-07-11 16:15:45

标签: git

目前我正在使用git log --graph --all来查看我的回购历史

我希望输出还包含完成提交的分支。我该怎么做?

当前输出:

* | commit 2da166d419c48555b1ce79784304632bf3f6e98f
| | Author: TechplexEngineer <techplex.engineer@>
| | Date:   Fri Jul 6 10:53:55 2012 -0400
| |
| |     Changed polled and exception mode to use the same logic to decide when t
| |     do a refresh/poll.
| |
* | commit b2b7a99931a917e697da3bc38be1636b33c1c44a
|/  Author: TechplexEngineer <techplex.engineer@>
|   Date:   Thu Jul 5 14:43:38 2012 -0400
|
|       Cleaned up comments and removed some old dead code
|
| * commit fb6d01eafca28aa3a84e72ed3f057486accd6532
|/  Author: cparent <Christopher.Parent@>
|   Date:   Fri Jul 6 10:38:28 2012 -0400
|
|       Got multiple reads and writes to happen in both
|       polled and exception mode

期望的输出:

* | commit 2da166d419c48555b1ce79784304632bf3f6e98f on branch Master
| | Author: TechplexEngineer <techplex.engineer@>
| | Date:   Fri Jul 6 10:53:55 2012 -0400
| |
| |     Changed polled and exception mode to use the same logic to decide when t
| |     do a refresh/poll.
| |
* | commit b2b7a99931a917e697da3bc38be1636b33c1c44a on branch Master
|/  Author: TechplexEngineer <techplex.engineer@>
|   Date:   Thu Jul 5 14:43:38 2012 -0400
|
|       Cleaned up comments and removed some old dead code
|
| * commit fb6d01eafca28aa3a84e72ed3f057486accd6532 on branch chris
|/  Author: cparent <Christopher.Parent@>
|   Date:   Fri Jul 6 10:38:28 2012 -0400
|
|       Got multiple reads and writes to happen in both
|       polled and exception mode

2 个答案:

答案 0 :(得分:2)

这是不可能的,因为提交的原始分支(如果有的话)不是由git记录的。

如果分支或标记当前指向提交,则使用--decorate注释提交是最好的。

答案 1 :(得分:0)

这不可能,因为分支只是指针到单个提交。因此,提交可以是许多不同分支的历史的一部分。最好你可以获得类似于gitk输出的东西,其中分支或标记只是提交旁边的标记。