When Migrating from Cloudflare Workers to Cloudflare Pages I used BFG Repo-Cleaner to remove all previous references to the contents folder on Github.

Steps

  • Installed java
  • Download the BFG jar file from the official repository. - sudo apt update - sudo apt install snapd - sudo snap install bfg-repo-cleaner - bfg --version
  • Cloned my repository
   git clone --mirror https://github.com/quantumgardener/qg.info.git
   cd repository.git
  • Removed the folder
   java -jar bfg.jar --delete-folders contents
  • Cleaned up with Git’s garbage collection:

     git reflog expire --expire=now --all && git gc --prune=now --aggressive
  • Pushed the changes back to Github

  • Pulled the changes back to my working repository