Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gist Vs. Repository for Tutorial

Tags:

github

gist

I'm publishing a tutorial that includes a lot of code interspersed with documentation. I'm considering two ways of hosting the code:

  1. Separate git repository with code files and markdown files explaining the code
  2. Github gist containing both of these

Are there advantages of hosting in a gist v/s a repository? When would one prefer one of these over the other?

like image 980
DivyaJyoti Rajdev Avatar asked May 01 '17 18:05

DivyaJyoti Rajdev


People also ask

What is difference between Gist and repository in GitHub?

The GitHub repository will hold or maintain the multiple version of the files or history of changes and you can retrieve a specific version of a file when you want. Whereas gist will create each post as a new repository and will maintain the history of the file.

What is Gist used for?

Gists let you share code snippets, entire files, or even applications. You can also use gists to save and share console output when running, debugging, or testing your code. Each gist is a repository that can be cloned or forked by other people.

What's a GitHub gist?

What is Gist? Gist is an easy method to share snippets or excerpts of data with others. A gist can be a string of code, a bash script or some other small piece of data. These bits of information are hosted by GitHub as a repository.


1 Answers

Gist is a simple way to share snippets and pastes with others. Whereas Repo is simply a place where the history of your work is stored.

There is no good answer, it's personal preference. I make mine a conceptual distinction. If it's code designed to demonstrate a technique, teach a principle, or show off a solution it goes in a gist. Doesn't matter if it's one file or 30 files. If it's actual code intended to be run, used as is, or forked as boilerplate I put it in a proper repository.

like image 173
Rahul Nigam Avatar answered Sep 21 '22 07:09

Rahul Nigam