TortoiseGit:为什么我的一些分支没有修订号?

TortoiseGit: Why do some of my branches not have revision numbers?

我们刚刚开始使用 TortoiseGit 中的修订号功能。今天早些时候,我注意到所有提交都有修订号,最高为 310。但是,在稍后提交新分支后,我注意到最新提交的修订号为 284。所有以前的提交都没有编号,除非它们在同一条图表流线上。

简而言之,为什么这些提交中有许多没有与之关联的修订号?是否有将所有这些编号在一起的分支视图?

我刚刚找到了答案。我需要调整分支视图。右键单击下面的 link,然后单击浏览到 select 新视角。

Git 没有(增量)修订号。您只能尝试模仿它们,例如通过计算之前的所有提交 - 但是,这不会提供唯一的修订号。

The branch revision number is calculated by calling git rev-list --count --first-parent [SHA1] and represents the number of commits between the beginning of time and the selected commit. This number is NOT guaranteed to be unique, especially if you alter the history (e.g., using rebase) or use several branches at the same time. It can be seen "kinda unique" per branch in case you don't alter its history (e.g. by rebasing, resetting) and only commit or merge other branches on it. This number is only displayed for first-parent commits and not for commits on non-fast-forward merges (here duplicate numbers could occur). See https://gcc.gnu.org/ml/gcc/2015-08/msg00148.html and https://gitlab.com/tortoisegit/tortoisegit/merge_requests/1 for more details.

https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-dialogs

为了减少混淆,TortoiseGit 除了当前分支或非快进合并之外不显示它们。