Reputation: 1344
I am migrating many svn repositories to many other git repositories. Those svn repos have more than 113000 commits. I end up with very large git repos and I like to shrink them.
I have used a script to find out the largest objects. These objects are not in any branches anymore and I wanted to know to which commit they where related. I could not find any ???
I used the command
git log --pretty=oneline --branches -- my_big_file_full_path
But nothing was returned. Can someone explain me why this file has no associated commits ? If that is really the case how to remove all the files that are not linked to any commits ?
PS : the migration process is quite heavy and I am using bfg (which is fantastic) to remove some known unused folders.
Upvotes: 2
Views: 92
Reputation: 1344
I have finally found the answer in another stackoverflow question Which commit has this blob? using the shell script allowed me to find the commit that modified the big file.
Upvotes: 1
Reputation: 54
Did you clean the repository after using The BFG? As mentiond in the "Usage" section on the BFG site you should use
$ cd some-big-repo.git
$ git reflog expire --expire=now --all
$ git gc --prune=now --aggressive
to get rid of objects in the repositories that are not part of any commit.
Upvotes: 1