Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wisicn/3b56b98378806df6959fc7db505b0ad2 to your computer and use it in GitHub Desktop.
Save wisicn/3b56b98378806df6959fc7db505b0ad2 to your computer and use it in GitHub Desktop.
How to make a private Gist public

Github provides no facility to do this via the UI. This is sad, because it would be extremely useful in order to draft something before publishing it. It would also be trivial for them to implement. Never mind; here's how to do it manually:

  1. Get the "Clone this Gist" text from the left-hand side of the private Gist, e.g. https://gist.github.com/b9cc265982870c091a1e.git, and extract the ID b9cc265982870c091a1e.
  2. Go to https://gist.github.com/ and create a dummy new public Gist.
  3. Get the "Clone this Gist" text from the left-hand side, e.g. https://gist.github.com/8270253.git, and extract the ID 8270253.
  4. git clone git@gist.github.com:b9cc265982870c091a1e tmp-dir && cd tmp-dir && git push -f git@gist.github.com:8270253.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment