简体   繁体   中英

Reduce size of remote git repository after rebasing?

After rebasing and doing a git push -f , the size of the repository gets larger every time. I have observed this behavior on both Bitbucket and Beanstalk. Every time I do one of the fast forward push, it seems that my 400k repository becomes 800k, then 1200k.

I trie doing git gc --aggressive locally and then doing git push -f , which didn't seem to reduce the remote repository size.

Any suggestions?

You'll basically have to wait for your remote provider to decide to gc for you. You may want to access commits referred to by the SHA1s now not pointed to by any history accessible from a branch (or eg maybe a pull request refers to those commits, even if the branches have been deleted).

You may be able to contact the customer service and get them to do this for you, as I know eg GitHub has this option (as it's exposed in the admin interface in github:enterprise).

There may be some automated trigger for this if you approach your size limits.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM