Git显示提交号码

时间:2014-01-23 11:14:00

标签: git version-control dvcs

有没有办法在

中显示提交的索引号
    git log

命令, git log只显示SHA1校验和。 感谢

1 个答案:

答案 0 :(得分:1)

Git提交没有索引号。 git存储库是提交树,它不是列表。

git log可以通过以下方式对提交进行排序:

Commit Ordering
   By default, the commits are shown in reverse chronological order.

   --topo-order
       This option makes them appear in topological order (i.e. descendant commits are shown before their parents).

   --date-order
       This option is similar to --topo-order in the sense that no parent comes before all of its children, but otherwise things are still ordered in the commit timestamp order.

   --reverse
       Output the commits in reverse order. Cannot be combined with --walk-reflogs.

如果git log会显示一个索引号,那么每次以不同的顺序显示提交时(如果你在另一个分支中合并),它都会改变。