-1

A colleague pushed two huge pickle files to our repository on BitBucket.

I contacted BitBucket's service and they managed to help me decrease the repository size from 1.5GB to ~890MB (while before this push the repository was around 150MB).

Now when I go into the repository's folder on my PC and I check the size of all the folders except the .git folder it's just the same as before the faulty push, which is around 150MB.

The problem now is that the .git folder is ~1.5GB.

I searched everywhere for a suggestion on how to deal with that without any luck.

Lior Magen
  • 1,533
  • 2
  • 15
  • 33
  • Did you try solutions like [this one](https://stackoverflow.com/questions/1904860/how-to-remove-unreferenced-blobs-from-my-git-repo#14728706) ? – Denys Séguret Jan 02 '18 at 10:27
  • @DenysSéguret I tried it already (BitBucket people suggested that) and the local repository decreases but the remote one doesn't. When I git fetch everything comes back and the local also becomes huge again. – Lior Magen Jan 02 '18 at 11:10
  • Are the big files required in your repo ? – LeGEC Jan 02 '18 at 13:43
  • You could reset to an earlier commit and then force push? – evolutionxbox Jan 02 '18 at 14:05
  • This answer should do the trick: https://stackoverflow.com/a/28173964/5061998 – gucce Jan 02 '18 at 15:02
  • 1
    Possible duplicate of [How to remove/delete a large file from commit history in Git repository?](https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository) – phd Jan 02 '18 at 16:20
  • @LeGEC No need for those files, deleted them and still they stayed in the repository cache or something like that. – Lior Magen Jan 03 '18 at 08:59
  • @phd nope, already tried that solution (offered me by BitBucket) but it didn't solve the issue, I explained it in my solution. – Lior Magen Jan 03 '18 at 09:00

1 Answers1

0

The solution offered here is exactly what BitBucket's customer service suggested and it solved it partially because each time I git fetch or git rebase everything went back to the previous (and faulty) version with the big files in.

The actual solution is to use the solution in the link but after that I had to delete the local repositories from all the machines (mine, my colleagues and VMs) and after that I had to clone a fresh copy of my repo, just than everything went fine.

Lior Magen
  • 1,533
  • 2
  • 15
  • 33