How to create and pin a gist on GitHub
Tags: github, opensource, gist, tutorial
Published: 2021-03-04 07:30:16

If you haven't heard of a gist before, it's an easy way to save, store, and share snippets of code or data with others. These little pieces of information are stored on GitHub and are easily accessible. A gist can be public or private, and they are available via a URL, just like a repository.

## How to create a gist

Firstly, how do you create a gist in GitHub? You can't really share information unless you know how to create it first right? Since everyone has been recently talking about [GitHub Skyline](https://skyline.github.com/) why don't we download my skyline.

![ezgif-4-5370f601a9b3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4p2p9dsiv25iy21aw2v5.gif)
 
We can upload and save the *.stl file as a gist. That way I can easily share my file for 3D printing, or send it to anyone I like. Here's how to download and save your Skyline:

1. Go to [GitHub Skyline](https://skyline.github.com/)
2. Enter your username and select the year you want to showcase
![Step 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/824nvf1cfhm3lzibrod7.PNG)
3. Once your Skyline has loaded, click "Download STL file"
![Step 3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1moakvbfhrciwfvrn65.PNG)
4. Go to [GitHub](https://github.com) and make sure you're signed in
5. Navigate to your profile and click options in the top right hand corner
![Step 5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4xp2kt2qmqdhthue73kz.PNG) 
6. Roll down and click "Your gists"
![Step 6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7sezp71aqrt3pegp4wo7.PNG)
7. Click the + symbol in the top right hand corner
![Step 7](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n8s8mgcjed75z0tjfpla.PNG) 
8. Name your gist and drag and drop your stl file
![Step 8  long](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6buv0bnr2ltvk1gzjzkw.PNG) 
9. Click the drop down to change between public and private (secret) gist
![Step 9](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yzg3gehj1pynvz3kc2oq.PNG)
10. Click "create [public/private] gist"
![Step 10](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nsdrczdq83b3jmooa2qx.PNG) 

Now you should be able to view your new gist. Since the Skyline is a 3D file, GitHub allows you to view the file in 3D.

![ezgif-6-ae9bf8306b74](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3zoq7bqyd104gfght3uy.gif)

Bonus: if you accidentally created a secret gist and you want to make it public, you can do so easily. Click "Edit" up in the top right hand bar, then click "Make public".

![Edit and make public](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dduje6khtpco578fina4.png) 
 
## How to pin a gist

Now that you've created a gist, you might want to quickly find this gist. All you need to do in order to save or pin your gist is to star it. Click on the gist you want to pin
and then click "Star" button in the top right.

![Star](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ykvwdtsd72nqlb8dbht.PNG)

Your gist is now easily found whenever you click "Starred" under gists, or select "Starred gists" from the drop down.

Toggle between "All gists" and "Starred gists":
![Tabbed or Star](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0wq663fmx24hxgplvb72.PNG)
 
Select starred gists from your profile dropdown:
![Drop down starred](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zi3args1navdhtt4bdvb.PNG)
 

You can star other users' gists and quickly share a gist by copying the URL for that gist.

How are you going to use this feature? Is there anything we missed? Let me know in the comments below, hit me up [on Twitter](https://twitter.com/MishManners), or go ahead and [star my gist](https://gist.github.com/MishManners/8c523651ca1ba50200391f6f24134971) on GitHub.