Clone a GitHub Gist Locally

By Joel Dare - Written July 10, 2024

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.

Build your next site in pure HTML and CSS

Want to build your next site in pure HTML and CSS? Join the free Five-Day Neat Starter Email Course and build a lean, production-ready page before Friday.

Email Me the Crash Course


JoelDare.com © Dare Companies Dotcom LLC

Terms - Privacy