Simon Willison: TILs on git

Atom feed for git

git Using git-filter-repo to set commit dates to author dates - 2023-07-10

After rebasing a branch with 60+ commits onto main I was disappointed to see that the commit dates on the commits (which are a different thing from the author dates) had all been reset to the same time. This meant the GitHub default UI for commits implied everything had been written at the same moment. …

git Rewriting a Git repo to remove secrets from the history - 2023-01-24

I decided to make a GitHub repository public today that had previously been private. Unfortunately the revision history of that repository included some secret values, one of which I could not figure out a way to revoke. …

git How to create a tarball of a git repository using "git archive" - 2022-11-15

I figured this out in a Gist in 2016 which has attracted a bunch of comments over the years. Now I'm upgrading it to a retroactive TIL. …

git git bisect - 2022-10-29

I extracted and enhanced this TIL from my April 8th 2020 weeknotes to make it easier to find. …

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. …