What is the difference between GitHub and gist?
What is the purpose of gist and h开发者_开发问答ow is it different from regular code sharing/maintaining using GitHub?
GitHub is the entire site. Gists are a particular service offered on that site, namely code snippets akin to pastebin. However, everything is driven by git revision control, so gists also have complete revision histories.
My personal view of Gist and GitHub:
Gist: Gist is a simple way to share code snippets and pastes with others. It is used when you need to share a sample piece of code or technique with your co-workers or friends.
And
GitHub GitHub, on the other hand, provides a platform to share an entire project as a repo among a team (private repo) or to the whole world (public repo).
Both will log version details.
The main differences between GitHub and gists are in terms of the number of features and user interface:
One is designed with a great number of features and flexibility in mind, which is a good fit for both small and very big projects, while gists are only a good fit for very small projects.
For example, gists do support multi-files, but the interface is very simple, and they're limited in features, so they don't even have a file browser, nor issues, pull requests or wiki. If you don't need to have that, gists are very nice and more discrete. Like the comments, instead of answers, in SO.
Note: Thanks to @Qwerty for the suggestion of making my comment a real answer.
My personal understanding or to say my personal usage of Gist and GitHub is:
- GitHub
A big project work. If you want to build website, develop mobile or web application, or do your assignment with your teammates, of course use GitHub.
- Gist
More like a memo. For example, you can write the implementation of a small feature and share it to your blog, or write down what you think about the project and share it with your teammates. Just like what the above answers said, Gist is used for more like code snippet thing. So normally if you work on a project, you use GitHub.
You can access Gist by visiting the following url gist.github.com. Alternatively you can access it from within your Github account (after logging in) as shown in the picture below:
Github: A hosting service that houses a web-based git repository. It includes all the fucntionality of git with additional features added in.
Gist: Is an additional feature added to github to allow the sharing of code snippets, notes, to do lists and more. You can save your Gists as secret or public. Secret Gists are hidden from search engines but visible to anyone you share the url with.
For example. If you wanted to write a private to-do list. You could write one using Github Markdown as follows:
NB: It is important to preserve the whitespace as shown above between the dash and brackets. It is also important that you save the file with the extension .md because we want the markdown to format properly. Remember to save this Gist as secret if you do not want others to see it.
The end result looks like the image below. The checkboxes are clickable because we saved this Gist with the extension .md
GitHub Gists
To gist or not to gist. That is the $64 question ...
GitHub Gists are Single (or, multiple) Simple Markdown Files
with repo-like qualities that can be forked or cloned (if public).
Otherwise, not if private.
Kinda like a fancy scratch pad that can be shared.
Similar to this comment scratch pad that I am typing on now, but a bit more elaborate.
Whereas, an official, full GitHub repo is a full blown repository of source code src
, supporting documents (markdown, html, or both) docs
or root
, images png
, ico
, svg
, and a config.sys
file for running Yaml variables hosted on a Jekyll server.
Does a simple Gist file support Yaml front matter?
Me thinks not.
From the official GitHub Gist documentation ...
The gist editor is powered by CodeMirror.
However, you can copy a public Gist (or, a private Gist if the owner has granted you access via a link to the private Gist) ...
And, you can then embed that public Gist into an "official" repo page.md
using Visual Studio Code, as follows:
"You can embed a gist in any text field that supports Javascript, such as a blog post."
"To get the embed
code, click the clipboard icon next to the Embed URL
button of a gist."
Now, that's a cool feature.
Makes me want to search (discover) other peoples' gists, or OPG and incorporate their "public" work into my full-blown working repos.
"You can discover the PUBLIC gists others have created by going to the gist home page and clicking on the link ...
All Gists{:title='Click to Review the Discover Feature at GitHub Gists'}{:target='_blank'}."
Caveat. No support for Liquid tags at GitHub Gist.
I suppose if I do find something beneficial, I can always ping-back, or cite that source if I do use the work in my full-blown working repos.
Where is the implicit license posted for all gists made public by their authors?
Robert
P.S. This is a good comment. I think I will turn this into a gist
and make it publically searchable over at GitHub Gists.
Note. When embedding the <script></script>
html tag within the body of a Markdown (.md) file, you may get a warning "MD033" from your linter.
This should not, however, affect the rendering of the data (src) called from within the script
tag.
To change the default warning flag to accommodate the called contents of a script
tag from within Visual Studio Code, add an entry to the Markdownlint Configuration Object within the User Settings
Json file, as follows:
// Begin Markdownlint Configuration Object
"markdownlint.config": {
"MD013": false,
"MD033": {"allowed_elements": ["script"]}
}// End Markdownlint Configuration Object
Note. Solution derived from GitHub Commit by David Anson
“Gists are actually Git repositories, which means that you can fork or clone any gist, even if you aren't the original author. You can also view a gist's full commit history, including diffs.”
→ check out the official github documentation
So the key difference is, that they are single files.
Oh, and: gists can be “secret” (as in: private url) also without being a paying github customer, if I understand correctly...
In simple words:
GitHub is the entire site.
Gists are some special services.
Usage Of Both:
Gist is a simple way to share snippets and pastes with others.
GitHub is a code hosting platform for version control and collaboration of projects.
Advantages Of Github:
Documentation, Discussions, Security Alerts of known Vulnerabilities and Exposures.
Advantages Of Gists:
Because each "gist" has its own Git repository, multiple code snippets can be contained in a single paste and they can be pushed and pulled using Git.
GISTS The Gist is an outstanding service provided by GitHub. Using this service, you can share your work publically or privately. You can share a single file, articles, full applications or source code etc.
The GitHub is much more than just Gists. It provides immense services to group together a project or programs digital resources in a centralized location called repository and share among stakeholder. 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.
github allows user to version control a bunch of files under one directory (called as repository). And user can create any number of repository. So all modification (creation/deletion/modification) on the complete directory (repository) is listed to user as one revision history.
where as gist allows user to version control a single file in markdown format. And user can create any number of files. Here the modications of each files are listed separtely to user as revision history.
Generally github
is for maintaining a large number of files & directories related to one task. For example software code of a project, website files, documentation files of a particular topic etc. Where as gist
is for maintaining a personal notes of a task in markdown format.
At a high level, creating a file in gist
is equivalent to creating a single file repository in github
.
精彩评论