different number of commits for "git clone" with and without "--mirror"

179 views Asked by At

So while trying to migrate a repository from bitbucket to github, I followed some steps to do the following:

1- git clone --mirror <bitbucket_repo>

2- cd in the repo folder

3- git push --mirror <github_repo>

And then to make sure all my commits are copied, I ran the following command in the cloned bitbucket_repo folder:

git rev-list --count --all

That gave me 25551 commits

And then I cloned the newly created github repo (with --mirror) and then ran the same command and I got 25557 commits

Now, I understand if the number of commits in the newly created repo is less. But I am getting more. I thought that git clone --mirror copies ALL the refs.

So I cloned the bitbucket repo without the --mirror option and checked the number of commits and it was 25557 commits.

I cloned the newly created github repo without the --mirror option and checked the number of commits and it was 25557 commits.

What am I missing here?

P.S: It is worth noting that when I run git rev-list --all --count --no-merges, all the commit numbers match!

0

There are 0 answers