My Repo Size is now 1.68 GB I removed the large file from all branched from bitbucket locally and remote but still repo size is too large.
Can you please advice how i can clean my remote repo to get the actual repo size?
Hello @Ahmed Shoeib,
Welcome to the Community.
I just ran aggressive garbage collection in your repository, and its size dropped to 1.3 GB. Not sure what was its size before you added that large file. If it is still in the history, you need to rewrite history to remove it completely like @DPK J suggested above.
Let me know if you have any questions.
In general it is impossible to say which branch introduced the file, unless your commit graph is very simple. Branch in Git is just a pointer to a commit, once you create another commit on top of that, the pointer is moved. When you merge branches, it is impossible to say, which parent of the merge commit was on which branch.
However you can find commits that modified that big file, then find all current branches (and tags) that have those commits in their history (e.g. commit is reachable from the commit at the brach pointer). Something like this should show all commits for the given file path:
git log --oneline --branches -- path/to/file
You'll then need to rewrite history up to the first commit that introduced that file (in case you want to completely remove it from history). See this section of Pro Git book for details.
@Ahmed Shoeib Welcome to the community!
Sometimes, some files stay attached in history or Bitbucket periodic cache clean has not kicked in yet to show you size related changes.
At this stage you can use tools like,
You must also read this KB article by Atlassian - https://confluence.atlassian.com/bitbucket/reduce-repository-size-321848262.html
Here is another important post, this was in my bookmark and I have used to remove file permanently and reduce repo size - https://confluence.atlassian.com/bitbucket/maintaining-a-git-repository-321848291.html
Hi everyone, We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events