Is there a way to get speed and reduced network traffic -depth = 1 clone, but then also get a count of the number of commits?
I am sure you cannot.
As you know, --depth=1 retrieves only the last message clicked. This means that when cloning with a depth of 1, you get 1 commit and only one commit without binding the story to it.
As for your local repository, the story does not exist, it's just 1 commit.
As also mentioned in docs
- depth
Create a shallow clone with a story truncated to the specified number of revisions .
Which is also interesting to me, even if you checked the origin
$ git rev-list --count origin/master $ git log origin/master
they will both show only 1 commit too.
source share