BFG Repo-Cleaner

I will now show you how to install and use BFG Repo-Cleaner on Windows.

Prerequisites

  • Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  • Java Runtime Environment
winget install -e --id Oracle.JavaRuntimeEnvironment

Instructions

  1. Clone your repo as a mirror.
git clone --mirror git://example.com/your-repo.git
  1. Run bfg.
bfg --strip-blobs-bigger-than 10M your-repo.git

or

bfg --strip-biggest-blobs 100 your-repo.git

or

bfg --strip-blobs-with-ids blobs.txt your-repo.git
  1. Prune.
cd your-repo.git
git reflog expire --expire=now --all
git gc --prune=now --aggressive 

References


89 Words

2021-02-18 05:36 +0000