Git显示提交编号

Git显示提交编号,git,version-control,dvcs,Git,Version Control,Dvcs,是否有一种方法可以在中显示提交的索引号 git log 指挥部, git日志只显示SHA1校验和。 谢谢,Git提交没有索引号。git存储库是提交树,而不是列表 git log可以通过以下方式对提交进行排序: Commit Ordering By default, the commits are shown in reverse chronological order. --topo-order This option makes them appear i

是否有一种方法可以在中显示提交的索引号

    git log
指挥部, git日志只显示SHA1校验和。
谢谢,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会向您显示一个索引号,那么每次您以不同的顺序显示提交时(如果您合并到另一个分支中),它都会发生更改。

正如已经给出的答案中所解释的,git没有索引号。如果你解释你的最终目标,有人可能会建议另一种方法来实现你想要的。@MagnusBäck,我想比较一下我的程序版本号和Git中的提交索引号,这并不是真正的最终目标,因为“提交索引号”在Git中不是一个有用的概念,所以你的问题仍然无法回答。如果您想用人类可读的东西来描述Git提交,甚至可能与您的版本号有关,那么可能对您很有用。