P
P
PK_D2020-02-07 15:46:07
git
PK_D, 2020-02-07 15:46:07

How to reduce the repository size?

Hello.
bitbucket - the repository has grown rapidly.
When publishing changes, a warning is displayed:


remote: Warning! Repository size in Bitbucket is currently 1.6 GB
remote: Above the 2 GB size limit further commits are rejected
remote: Reduce repository size by removing large files from history


There is an article describing the problem and solution methods: https://web.archive.org/web/20190207210108/http://...

I followed the recommendations:
  • git filter-branch --tag-name-filter cat --index-filter 'git rm -r --cached --ignore-unmatch filename' --prune-empty -f -- --all
  • rm -rf .git/refs/original/
  • git reflog expire --expire=now --all
  • git gc --prune=now
  • git gc --aggressive --prune=now
  • git push origin --force --all


Before following these recommendations, BitBucket showed 1.2GB
After running the last command, it shows 1.6GB

If you make a new clone, the project folder will weigh ~200MB:

remote: Counting objects: 38343, done.
remote: Compressing objects: 100% (20573/20573), done.
remote: Total 38343 (delta 11421), reused 0 (delta 0)
Receiving objects: 100% (38343/38343), 200.05 MiB | 1.90 MiB/s, done.
Resolving deltas: 100% (18164/18164), done.
Checking out files: 100% (5864/5864), done.


How to correct this situation?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question