title: How to reduce the size of the remote repo by deleting size-hungry branch?
body: <p>In our git repo, one of the branches contains binary files that were committed and pushed to the remote repo for testing, however this has led to unintended consequence of filling up the size of our repo. After doing some research <a href="https://itextpdf.com/blog/how-completely-remove-file-git-repository" rel="nofollow noreferrer">here</a> and <a href="https://confluence.atlassian.com/bitbucket/reduce-repository-size-321848262.html" rel="nofollow noreferrer">here</a> and then some, a number of scenarios are provided in which solutions vary greatly. I am wondering if we have a simpler scenario that avoids "git push --all --force"(which requires greater coordination) that we may be to take advantage of.</p>
  
  <p>In our case, we don't care that the branch exists anymore and are perfectly fine with it getting removed (along with its history etc). We can take the work involved and recommit it in another branch. Since the branch hasn't been merged to its master, is it possible for us to delete the branch entirely. Assuming that references are self-contained in the branch to the binaries committed, is there a simpler solution?</p>
  
  <p>From the research, the following solutions have been called out: </p>
  
  <ul>
  <li><a href="https://rtyley.github.io/bfg-repo-cleaner/" rel="nofollow noreferrer">BFG Repo-Cleanerx</a></li>
  <li><a href="https://git-scm.com/docs/git-rebase" rel="nofollow noreferrer">Interactive Rebase</a></li>
  <li><a href="https://git-scm.com/docs/git-filter-branch" rel="nofollow noreferrer">git filter-branch</a></li>
  </ul>
  
  <p>However they assume that the reader wants to retain the history and as such remove the offending binaries, rewrite the history and/or that the issue is still localized to the local repository. If the issue is remote, a fix to local is required and then push --all to remote.</p>
  
  <p>In this case, we have already deleted the branch and recommitted the work on a fresh branch, but the size hasn't changed yet, what else do we need to do? Is there an easier solution since the data is localized to the deleted branch and the branch is allowed to be deleted? We also aren't sure if git will keep the binaries in some way in order to keep references to them in other parts of the history. Is garbage collection required at the remote server? pruning of references?</p>