I have a large git repository with 17 years of history. After converting it with svn2git, I usually do a 'git repack -a -d -f'. This says 'Nothing new to pack.' Then if I push it to the server (in my case Bit Bucket), and then locate the repository on the server and do repack, it repacks the whole repository. I would like to be able to always repack the whole repo if possible. I can't figure out what the changes are between pushing to the server, that allows the repack. Note, there are no changes made to the repository between the client and server.

1

There are 1 best solutions below

0
On

The output you are seeing comes from these source lines:

    if (!names.nr && !quiet)
            printf("Nothing new to pack.\n");

Here names.nr is the number of SHA-1 ID lines read from the git pack-objects command, when run with the arguments provided in the argv and environment computed earlier in this same code.

What's happening in this case is that whatever svn2git utility you are using is building a single pack file, and for whatever reason, git pack-objects is choosing to leave that file alone.

What I cannot explain is why -a -d -f did not force a repack, because it should. The git pack-objects command should have generated a new pack file with new compression. (I suppose one possibility is that git pack-objects is simply failing entirely on your particular system, but then you should get a complaint about that, too.)