Simon Willison: TILs on git

git Rewriting a repo to contain the history of just specific files - 2022-03-22

I wanted to start a new git repository containing just the history of two specific files from my help-scraper repository. …

git Removing a git commit and force pushing to remove it from history - 2021-10-22

I accidentally triggered a commit which added a big chunk of unwanted data to my repository. I didn't want this to stick around in the history forever, and no-one else was pulling from the repo, so I decided to use force push to remove the rogue commit entirely. …