SixFoisNeuf

Totally irregular blog on computers and security


Clone arbitrary single Git commit

Written on May 24, 2024

Nice nugget found in this Lobste.rs comment chain: cloning a single Git commit.

$ mkdir repo && cd repo
$ git init
$ git fetch --depth=1 REPO_URL COMMIT_ID
$ git reset --hard COMMIT_ID