git GitHub 和 gist 有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6767518/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the difference between GitHub and gist?
提问by NSExplorer
What is the purpose of gist and how is it different from regular code sharing/maintaining using GitHub?
gist 的目的是什么,它与使用 GitHub 的常规代码共享/维护有何不同?
采纳答案by Kerrek SB
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.
GitHub 是整个站点。Gist 是该站点上提供的一项特殊服务,即类似于 pastebin 的代码片段。然而,一切都是由 git 修订控制驱动的,所以 gist 也有完整的修订历史。
回答by Jayavignesh Vicky
My Personal View of Gist and GitHub:
我个人对 Gist 和 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.
Gist:Gist 是一种与他人共享代码片段和粘贴的简单方法。当您需要与您的同事或朋友共享示例代码或技术时,可以使用它。
And
和
GitHubGitHub, 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).
另一方面,GitHubGitHub 提供了一个平台,可以在团队(私有仓库)或全世界(公共仓库)之间共享整个项目作为仓库。
Both Will log version details.
两者都将记录版本详细信息。
回答by joseLuís
The main differences between github and gists are in terms of number of features and user interface:
github 和 gist 之间的主要区别在于功能数量和用户界面:
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.
一个是在设计时考虑到了大量的特性和灵活性,它非常适合小型和非常大的项目,而 gist 只适合非常小的项目。
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 dont need to have that, gists are very nice and more discrete. Like the comments, instead of answers, in SO.
例如,gist 确实支持多文件,但界面非常简单,而且它们的功能有限,因此它们甚至没有文件浏览器,也没有问题、拉取请求或 wiki。如果您不需要它,那么要点非常好且更加离散。喜欢评论,而不是答案,在 SO。
Note: Thanks to @Qwerty for the suggestion of making my comment a real answer.
注意:感谢@Qwerty 建议让我的评论成为真正的答案。
回答by J.DoG
My personal understanding or to say my personal usage of Gist and Github is:
我个人的理解或者说我个人对 Gist 和 Github 的使用是:
- Github
- GitHub
A big project work. If you wanna build website, develop mobile or web application or do your assignment with your teammates of course use github.
一个大项目工作。如果您想建立网站、开发移动或网络应用程序或与您的队友一起完成任务,当然使用 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.
更像是备忘录。例如,您可以编写一个小功能的实现并将其分享到您的博客或写下您对该项目的看法并与您的团队成员分享。就像上面的答案所说的一样,gist 用于更像代码片段的东西。所以通常如果你在一个项目上工作,你会使用 github。
回答by JSON C11
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:
您可以通过访问以下 URL gist.github.com来访问 Gist 。或者,您可以从您的 Github 帐户中访问它(登录后),如下图所示:
Github:A hosting service that houses a web-based git repository. It includes all the fucntionality of git with additional features added in.
Github:托管服务,包含基于 Web 的 git 存储库。它包括 git 的所有功能,并添加了附加功能。
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.
Gist:是添加到 github 的附加功能,允许共享代码片段、笔记、待办事项列表等。您可以将 Gists 保存为秘密或公开。秘密要点对搜索引擎是隐藏的,但对与您共享 url 的任何人可见。
For example. If you wanted to write a private to-do list. You could write one using Github Markdown as follows:
例如。如果你想写一个私人的待办事项清单。你可以使用 Github Markdown 写一个如下:
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 .mdbecause we want the markdown to format properly. Remember to save this Gist as secret if you do not want others to see it.
注意:如上图所示,在破折号和括号之间保留空白非常重要。使用扩展名 .md 保存文件也很重要,因为我们希望 Markdown 格式正确。如果您不想让其他人看到它,请记住将此 Gist 保存为机密。
The end result looks like the image below. The checkboxes are clickable because we saved this Gist with the extension .md
最终结果如下图所示。复选框是可点击的,因为我们使用扩展名 .md 保存了这个 Gist
回答by Frank Nocke
“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.”
“Gist 实际上是 Git 存储库,这意味着您可以分叉或克隆任何 Gist,即使您不是原作者。您还可以查看 Gist 的完整提交历史记录,包括差异。”
→ check out the official github documentation
→查看官方github文档
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...
哦,还有:如果我理解正确的话,要点也可以是“秘密”(如:私人网址),也可以不是付费的 github 客户……
回答by Robert Weber
GitHub Gists
GitHub 要点
To gist or not to gist. That is the $64 question ...
要点或不要点。那是 64 美元的问题...
GitHub Gistsare Single ( or, multiple ) Simple Markdown Files
with repo-likequalities that can be forked or cloned ( if public ).
GitHub的要旨是Single ( or, multiple ) Simple Markdown Files
与回购状可分叉或克隆(如果公共)的品质。
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 or html, or both ) docs
or root
, images png
, ico
, svg
, and a config.sys
file for running Yaml variables hosted on a Jekyll server.
然而,一个正式,完整的GitHub库的源代码一个完全成熟的存储库src
,支持文件(降价或HTML,或两者)docs
或root
,图片png
,ico
,svg
,和一个config.sys
用于运行托管的哲基尔服务器上YAML变量文件。
Does a simple Gist file support Yaml front matter?
一个简单的 Gist 文件是否支持 Yaml 前端?
Me thinks not.
我认为不是。
From the official GitHub Gist documentation ...
来自官方 GitHub Gist 文档...
The gist editor is powered by CodeMirror.
要点编辑器由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 ) ...
但是,您可以复制公共 Gist(或者,如果所有者已通过私有 Gist 的链接授予您访问权限,则为私有 Gist)...
And, you can then embed that public Gist into an "official" repo page.md
using Visual Studio Code, as follows:
然后,您可以page.md
使用 Visual Studio Code将该公共 Gist 嵌入到“官方”存储库中,如下所示:
"You can embed a gist in any text field that supports Javascript, such as a blog post."
“您可以在任何支持 Javascript 的文本字段中嵌入要点,例如博客文章。”
"To get the embed
code, click the clipboard icon next to the Embed URL
button of a gist."
“要获取embed
代码,请单击Embed URL
要点按钮旁边的剪贴板图标。”
Now, that's a cool feature.
现在,这是一个很酷的功能。
Makes me want to search ( discover ) other peoples' gists, or OPGand incorporate their "public" work into my full-blown working repos.
让我想要搜索(发现)其他人的要点或OPG,并将他们的“公共”工作纳入我成熟的工作存储库中。
"You can discover the PUBLIC gists others have created by going to the gist home page and clicking on the link ...
“您可以通过转到要点主页并单击链接来发现其他人创建的 PUBLIC 要点......
All Gists{:title='Click to Review the Discover Feature at GitHub Gists'}{:target='_blank'}."
所有 Gists{:title='单击以查看 GitHub Gists 上的发现功能'}{:target='_blank'}。"
Caveat. No support for Liquid tags at GitHub Gist.
警告。GitHub Gist 不支持 Liquid 标签。
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.
PS这是一个很好的评论。我想我会把它变成一个,gist
并让它在 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.
注意。当嵌入<script></script>
一个降价(.MD)文件的正文中的HTML标签,你可以从你得到一个警告“MD033”棉短绒。
This should not, however, affect the rendering of the data ( src ) called from within the script
tag.
但是,这不应影响从script
标记内调用的数据 ( src ) 的呈现。
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 Objectwithin the User Settings
Json file, as follows:
要更改默认警告标志以适应script
Visual Studio Code 中标签的调用内容,请向Json 文件中的Markdownlint 配置对象添加一个条目User Settings
,如下所示:
// 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
注意。来自David Anson 的 GitHub Commit 的解决方案
回答by Sunil Vishnu Raskar
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.
GISTS Gist 是 GitHub 提供的一项出色服务。使用此服务,您可以公开或私下分享您的作品。您可以共享单个文件、文章、完整的应用程序或源代码等。
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 不仅仅是 Gists。它提供了大量的服务,可以将一个项目或程序的数字资源组合到一个称为存储库的集中位置,并在利益相关者之间共享。GitHub 存储库将保存或维护文件的多个版本或更改历史记录,您可以在需要时检索文件的特定版本。而 gist 会将每个帖子创建为一个新的存储库,并将维护文件的历史记录。