2014-01-23 33 views
1

有沒有辦法來顯示Git的節目數量提交

git log 

命令提交的索引號, git的日誌只顯示我的SHA1校驗和。 謝謝

+0

正如已經給出的答案中所解釋的,Git沒有索引號。如果你解釋你的最終目標,那麼有人可能會提出另一種實現你想要的方式。 –

+0

@MagnusBäck,我想比較我的程序版本號和提交索引號在git –

+0

這不是一個真正的最終目標,並且由於「提交索引號」在Git中不是一個有用的概念,所以您的問題仍然無法解答。如果你想用一些人類可讀的東西來描述一個Git commit,甚至可能涉及到你的版本號[git describe'](https://www.kernel.org/pub/software/scm/git/docs/git -describe.html)可能對您有用。 –

回答

1

Git提交沒有索引編號。一個git倉庫是一個提交樹,它不是一個列表。

git的日誌可以訂購承諾在以下幾個方面:

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的日誌會告訴你的索引號,將每一次改變你展現不同的順序提交(如果你在另一個合併科)。