Git:自标记以来计数提交 [英] Git: Count commits since tag

查看:86
本文介绍了Git:自标记以来计数提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自标签创建以来,我正试图计算提交次数.

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.7StartHEAD具有不同的根提交. (语法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迁移而来的,而master1.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆