Home

Clone a GitHub Gist Locally

A Gist on GitHub is a basic repository. I figured out that you can clone them and keep copies locally, just like any other repository.

Even though I’ve used Gist’s a fair amount it never became obvious to me that you could clone them.

Here are the steps.

  1. Go to the Gist on GitHub (e.g. https://gist.github.com/{username}/{id}).
  2. Copy either the “Clone via HTTPS” or “Clone via SSH” URL (the default action is “Embed”).
  3. Run the command git clone {url} {name} locally.

That will clone the Gist and give it a readable name. If you don’t give it a name it will clone as it’s 32-byte ID (e.g. 0654e4e3571ccdca5ceffc63cde6308e).

That’s it, you now have a local copy that you can push, pull, and otherwise edit.

Written by Joel Dare on July 10, 2024.


JoelDare.com © Dare Companies Dotcom LLC

Terms - Privacy