0

目前我正在使用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
4

2 回答 2

2

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

如果提交当前由分支或标签指向,则使用--decoratewhich 将注释提交,这是您可以获得的最佳效果。

于 2012-07-11T16:23:18.270 回答
0

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

于 2012-07-11T16:23:54.177 回答