Git:自标记以来计数提交 [英] Git: Count commits since tag
问题描述
自标签创建以来,我正试图计算提交次数.
I am trying to count the number of commits since a tag was made.
我尝试使用git rev-list
,但是无论我尝试如何,它似乎都返回相同的结果.这是我尝试过的:
I have tried using git rev-list
but it seems to return the same results no matter what I try. This is what I have tried:
$ git rev-list 1.7Start^..HEAD | wc -l
13902
$ git rev-list HEAD | wc -l
13902
尝试计算自创建1.7Start标记以来的提交次数.我目前在master
上,因此使用HEAD
,但是使用git rev-list master | wc -l
可以得到相同的结果.
Trying to count how many commits since the 1.7Start tag was created. I'm currently on master
hence using HEAD
but using git rev-list master | wc -l
gives me the same.
从1.7开始,没有超过13000次提交
There hasn't been 13000+ commits since 1.7
git rev-list master
应该向我显示master中的每个提交并因此产生比1.7Start^..master
大的数字吗?
Should git rev-list master
show me every commit in master and hence yield a larger number than 1.7Start^..master
which should just give me the difference?
推荐答案
您得到的结果表明1.7Start^
和HEAD
之间没有共同的历史记录,因此1.7Start
和HEAD
具有不同的根提交. (语法a..b
传递给git rev-list
时仅表示"b
中的所有提交,而a
中没有."
The results that you're getting suggest that there is no history in common between 1.7Start^
and HEAD
, so 1.7Start
and HEAD
must have different root commits. (The syntax a..b
when passed to git rev-list
just means "every commit in b
which isn't in a
.)
在上面的评论中,提问者指出这是由于存储库是从Subversion迁移而来的,而master
与1.7Start
所指向的导入分支完全不同.
In the comments above, the questioner indicated that this arose because the repository was migrated from Subversion, and master
is entirely distinct from the imported branch that 1.7Start
points to.
这篇关于Git:自标记以来计数提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!