GitHub Gist¶
Gist Features¶
Using GitHub Gist, you can save your written code to your GitHub account with one click and share it with others using a sharing URL. It's a convenient tool for the following purposes:
- Want to share code when asking questions
- Want to show code to others
- Want to save and backup written code
- Want to share code for small projects
What You Need to Use Gist¶
- GitHub account (free)
Usage Instructions¶
- Access GitHub Gist (login required).
- Enter the source file name. Using an extension like
.cpp
(e.g.,Main.cpp
) will apply C++ syntax highlighting. - Write or paste your code.
- Click "Create secret Gist".
- The code is saved on Gist and a unique URL is generated.
- Anyone who knows the URL can view the code.
Example¶
https://gist.github.com/Reputeless/4d25a6032e4c84f0064b81dfafbbdce2
Advanced Usage¶
- Published Gists can be modified by clicking "Edit" in the top right, keeping the same URL while changing the content. Change history is recorded in "Revisions".
- You can add multiple source files.
- While images and audio files cannot be saved, text files like JSON and XML can be saved.
- Writing in Markdown format (with .md extension) will display a preview on the Gist page.