Dear Bitbucket support team,
We have a repo that has over 2 GB (thus the warning).
I wasn't quite 100% sure on the sequence of git commands to run to first delete select large files and clean the history. I was able to clean it following the instructions below and removed large CSV files from my repo delete_history_test. The repo is still 66MB and should be much smaller. Can you run the GC on that repo, so I have proof that these instructions work? After which I'll talk to my team to clean up our repo and I suppose we will need to trigger a GC next week.
Dummy Exercise:
What I wanted to have is
The large files exist in both the main and the infected branches, so I did:
Then, I clean the history doing:
git filter-branch -f --prune-empty --index-filter "git rm --cached -f --ignore-unmatch large_file.csv" --
I suspect after this point, all of the histories should be clean and I need to trigger the GC from the remote which I can't trigger.
Can you trigger it to this repo delete_history_test so I can make sure it works?
Thanks,
Justin
Hi Justin,
I ran a git gc for this repo and its size is 58.6 MB now.
Can you take a mirror clone of the repo and execute git count-objects -Hv in the mirror clone directory, and let me know what you see in the output?
Kind regards,
Theodora
Hi Theodora, here's my output from that command:
How come the repo is still 58MB ? There is barely anything in the repo?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your first post, you mentioned that the repo has more than one branch.
1. Does your clone (where you executed git count-objects -Hv) have all branches locally?
If you haven't pulled all remote branches locally, then the local repo will be of a smaller size.
2. Could you please take a mirror clone of the repo delete_history_test
git clone --mirror <repo_url>
and then run git count-objects -Hv in that mirror clone, and let me know what the output is?
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Theodora Boudale
Initially yes it had more than one branch. In the meantime I had discovered that maybe I could use LFS to move those files there, and I tried to play around with it. At one point in time, the repo went down to 60 KB when I had first created another branch and installed LFS and added the gitattributes for CSV files, but after merging it, the repo went back to 66MB. I tried to reproduce but I couldn't. In the end I deleted the LFS file and tried to clean it up to bring it back to that initial state.
Here's a screenshot of the commands you told me to run:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the info.
Since the mirror clone also shows a size of 8.96 KB, we will need to inspect the remote repo to see what takes up extra space.
I cannot access your repo in order to check that, we need a support ticket in order to be able to access a remote repo.
I see that the test repo delete_history_test belongs to your personal workspace, but there is no other repo there over 2 GB.
I also see that you are a member of a workspace on a paid billing plan.
Does the repo that has a size of over 2 GB belong to that workspace?
If so, what you can do is:
However, if delete_history_test repo is not related to a repo on that paid workspace and it's your personal repository, please feel free to let me know and I can create the support ticket for you.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.