git

18 posts tagged “git”.

  1. 2025
  2. Clone, edit and push files that live in a Gist

    GitHub Gists are full Git repositories, and can be cloned and pushed to. You can clone them anonymously (read-only) just using their URL: git clone…

    1 min read
  3. Automatically maintaining Homebrew formulas using GitHub Actions

    I previously wrote about Packaging a Python CLI tool for Homebrew. I've now figured out a pattern for automatically updating those formulas over time, using GitHub Actions.

    3 min read
  4. Convert git log output to JSON using jq

    I just spent way too long messing around with ChatGPT (transcript here) trying to figure this out. After much iteration, here's a recipe that works (mostly written by me at this point): The output…

    1 min read
  5. Build the official Python documentation locally

    First, checkout the cpython repo: $ git clone git@github.com:python/cpython cd into the directory: $ cd cpython/Doc To get a virtual environment with Sphinx and other required tools, run like this: $…

    1 min read
  6. 2024
  7. Convert a datetime object to UTC without using pytz

    I wanted to convert a datetime object (from GitPython) to UTC without adding the dependency.

    1 min read
  8. Calculating the size of all LFS files in a repo

    I wanted to know how large the deepseek-ai/DeepSeek-V3-Base repo on Hugging Face was without actually downloading all of the files. With some help from Claude, here's the recipe that worked.

    1 min read
  9. Removing a git commit and force pushing to remove it from history

    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…

    1 min read
  10. Using git-filter-repo to set commit dates to author dates

    After rebasing a branch with 60+ commits onto 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.

    1 min read
  11. Rewriting a repo to contain the history of just specific files

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

    1 min read
  12. Back-dating Git commits based on file modification dates

    https://www.w3.org/History/1991-WWW-NeXT/Implementation/ It's served up as a browseable Apache directory listing, but that's not the most delightful way to browse code - clicking a link to a file…

    2 min read
  13. Browsing your local git checkout of homebrew-core

    The homebrew-core repository contains all of the default formulas for Homebrew. It's a huge repo, and if you browse it through the GitHub web interface you can run into errors like this one…

    1 min read
  14. Conditionally running a second job in a GitHub Actions workflow

    My simonwillisonblog-backup workflow periodically creates a JSON backup of my blog's PostgreSQL database, using db-to-sqlite and sqlite-diffable.

    1 min read
  15. Assistance with release notes using GitHub Issues

    I like to write the release notes for my projects by hand, but sometimes it can be useful to have some help along the way. Today I figured out this recipe.

    2 min read
  16. 2023
  17. Commit a file if it changed

    This recipe runs a Python script to update a README, then commits it back to the parent repo but only if it has changed: My first attempt threw an error if I tried o run and the README had not…

    1 min read
  18. Rewriting a Git repo to remove secrets from the history

    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…

    1 min read
  19. GitHub Actions job summaries

    New feature announced here. Here's the full documentation. These are incredibly easy to use. GitHub creates a file in your workspace and puts the filename in , so you can build the summary markdown…

    1 min read
  20. How to create a tarball of a git repository using "git archive"

    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.

    1 min read
  21. git bisect

    I fixed two bugs in Datasette using - a tool which lets you run an automated binary search against a commit log to find the source of a bug.

    1 min read