# Problems with git commit count

**URL:** <https://discuss.circleci.com/t/problems-with-git-commit-count/339>\
**Category:** Build Environment\
**Tags:** git\
**Created:** [November 4, 2015, 12:46am UTC](https://discuss.circleci.com/t/problems-with-git-commit-count/339 "2015-11-04T00:46:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aexmachina](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/aexmachina/32/251_2.png) [@aexmachina](https://discuss.circleci.com/u/aexmachina)\
**Post date:** [November 4, 2015, 12:46am UTC](https://discuss.circleci.com/t/problems-with-git-commit-count/339/1 "2015-11-04T00:46:17Z")

</div>

We use a git command to generate build numbers in a way which works for CI and for developer machines, but when we run this command on CircleCI we get a different result. Is there any reason why the command `git rev-list --count HEAD` would return a different (lower) number when run on CircleCI than on any of our other machines? I’ve run this command with a newly cloned repo and I get the correct number, it’s only on CircleCI that I get the wrong number.

---

<div class="post-metadata">

**Author:** ![aexmachina](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/aexmachina/32/251_2.png) [@aexmachina](https://discuss.circleci.com/u/aexmachina)\
**Post date:** [November 4, 2015, 12:47am UTC](https://discuss.circleci.com/t/problems-with-git-commit-count/339/2 "2015-11-04T00:47:07Z")

</div>

The reply from CircleCI team was:

> In order to reduce our burden on GitHub, we do a shallow clone instead of a full one. If this is a problem, you can try running git fetch --unshallow prior to running git rev-list --count HEAD.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:37am UTC](https://discuss.circleci.com/t/problems-with-git-commit-count/339/3 "2018-06-18T11:37:33Z")

</div>

Closed on June 18, 2018, 11:37am UTC


