Search code examples
githubgist

Gist Vs. Repository for Tutorial


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?


Solution

  • 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.