Skip to content

Changes After April 2016 Cleanup

James Kao edited this page May 1, 2016 · 1 revision

On April 29, 2016, the binary history of area515/Creation-Workshop-Host was cleaned up to reduce the download footprint of the repo from 500MB to 30MB by using the BFG Repo Cleaner to remove the old checked-in zip releases.

If you have forks or clones of area515/Creation-Workshop-Host from before this date, you will need to perform some steps to synchronize your fork with the re-written history.

Easy Way

The easiest way to deal with the change is to delete your repo or fork and then re-clone or re-fork it.

Direct Clones of area515

  1. Copy any un-pushed changes aside to some location outside of your repo
  2. Delete your local repo: rm -r Creation-Workshop-Host)
  3. Clone the remote repo: git clone https://github.com/area515/Creation-Workshop-Host
  4. Manually re-apply any changes you copied aside in step 1.

You're done!

Forks of area515

  1. Copy any un-pushed changes aside to some location outside of your repo
  2. Delete your local repo: rm -r Creation-Workshop-Host
  3. Delete your fork from github: https://help.github.com/articles/deleting-a-repository/
  4. Create a new fork of area515/Creation-Workshop-Host: https://github.com/area515/Creation-Workshop-Host
  5. Manually re-apply any changes you copied aside in step 1.

This is by far the easiest way to bring your history in-line with area515 so that PRs will work again, and will cleanup your own fork's history so that clones of your repo will be the post-clean 30MB instead of 500MB. The downside of this procedure is that this may reset your Stars and Watches.

Hard Way (forks only)

This is only relevant for forks. Local clone should just be re-cloned, there are no drawbacks to doing that. For a fork, you may want to retain your existing Stars or Watches. I would highly recommend that you consider whether that is worthwhile before embarking on this path.

There are two goals that we need to handle separately down this path:

  • Updating your GitHub repo history so that it matches area515's post-clean history. This will enable you to properly submit PRs.
  • Cleaning up the binary contents of your repo so that its actual size drops from 500MB to 30MB

Update GitHub Repo History

Completing this will enable you to properly submit PRs, but the size of clones of your repo will remain the same (e.g. still 500 MB)

  1. Copy any un-pushed changes to some location outside of your repo
  2. Delete your local repo: rm -r Creation-Workshop-Host
  3. Clone the cleaned area515 repo: git clone https://github.com/area515/Creation-Workshop-Host area515-cwh
  4. cd area515-cwh
  5. Change the origin URL to be your own fork: git remote set-url origin https://github.com/<YOUR USERNAME>/Creation-Workshop-Host
  6. Force push the local repo to your remote fork - this will overwrite your repo's contents: git push --force origin master
  7. Delete the local repo (rm -r area515-cwh) and clone your fork again (`git clone https://github.com//Creation-Workshop-Host

If you are satisfied with just being able to submit PRs again and don't care about the download size of your repo. You can stop here and re-apply any un-pushed changes that you copied aside in step 1.

If you wish to now clean up your repo, proceed to the next section.

Cleanup Binary Contents of Fork

To actually clean up your fork, you will need to go through the same cleanup process that I used to clean area515's repo. This is annoying, you might want to reconsider going down the Easy Way.

  1. Download the BFG repo cleaner https://rtyley.github.io/bfg-repo-cleaner/
  2. Make a bare repo clone of your fork: git clone --mirror https://github.com/<YOUR USERNAME/Creation-Workshop-Host
  3. Use BFG to clean the repo: java -jar bfg-1.12.12.jar --delete-files 'cwh*.zip' --strip-biggest-blobs 100 Creation-Workshop-Host.git
  4. cd Creation-Workshop-Host.git
  5. Make git garbage collect: git reflog expire --expire=now --all && git gc --prune=now --aggressive
  6. Push your changes back to github: git push
  7. Delete your bare repo (e.g. rm -r Creation-Workshop-Host.git)
  8. Do Update GitHub Repo History steps again!!!

Now you can re-apply any un-pushed changes you set aside and re-clone your fork.

Clone this wiki locally