git GitHub 中的 Release 到底是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33551505/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:29:45  来源:igfitidea点击:

What exactly is a Release in GitHub?

gitgithubreleasegithub-api

提问by Ernst Ernst

  • What is it exactly?
  • For what is it used?
  • How widespread is the usage?
  • How is it usually used?
  • 究竟是什么?
  • 它的用途是什么?
  • 使用范围有多广?
  • 它通常如何使用?

回答by Ernst Ernst

From Official GitHub:

来自官方 GitHub

Releasesare GitHub'sway of packaging and providing software to your users. You can think of it as a replacement to using downloads to provide software.

发布GitHub向用户打包和提供软件方式。您可以将其视为使用下载来提供软件的替代。

With Releases, you can provide links to binary files, as well as release notes describing your changes.

使用Releases,您可以提供二进制文件的链接,以及描述您的更改的发行说明。

At their core, Releasesare based on Git tags. Tags mark a specific point in the history of your project, so they're a great way to indicate a Release. Releasesare ordered by a tag's date in the following way:

发布的核心是基于Git 标签。标签标记了项目历史上的特定点,因此它们是指示发布的好方法。发布按标签的日期按以下方式排序:

For more information about viewing your existing tags, see Working With Tags.

有关查看现有标签的更多信息,请参阅使用标签

回答by VonC

I would like to backup this official explanation from people who are already using that to see how it works.

我想从已经使用它的人那里备份这个官方解释,看看它是如何工作的。

Definition

定义

As mentioned in "About Releases"

如“关于发布”中所述

Releases are GitHub's way of packaging and providing software to your users. You can think of it as a replacement to using downloads to provide software.

发布是 GitHub 向用户打包和提供软件的方式。您可以将其视为使用下载来提供软件的替代。

A release is a container of one or more assets, associated to a git annotated tag(since git push --follow-tagsonly pushes annotated tags)

发布是一个或多个资产的容器,与 git 注释标签相关联(因为git push --follow-tags只推送带注释的标签

It replaces since July 2013 an old "GitHub Download" systemwhich was beginning to get abused(people stored anything and everything in it), and removed in Dec. 2012.
By forcing an indirection (tag => release => asset), GitHub made that feature more manageable.

它取代了自7月2013老“GitHub上下载”系统这是开始有点虐待(人存放在其予取予求),并在2012年十二月去除
通过强制的间接(标签=>发布=>资产),GitHub上使该功能更易于管理。



Usage

用法

A GitHub release is used:

使用 GitHub 版本:

  • to avoid storing large generatedbinaries built from project in a sourcecontrol system like git.
  • by users of a repo to download the "end result", ie the "delivery" already built for them from a git repo content, even if they don't have git.
  • 避免在像 git 这样的源代码控制系统中存储从项目构建的大型生成的二进制文件。
  • 存储库的用户下载“最终结果”,即已经从 git 存储库内容为他们构建的“交付”,即使他们没有 git。


Example

例子

An example of a project using releases would be git for windows releases.
In the case of git for Windows, that comes in handy considering that you might want to install git in the first place, and you might not have the right tool-set to compile its sources.

使用发行版的项目的一个例子是git for windows 发行版
git for Windows的情况下,考虑到您可能想要首先安装 git,并且您可能没有正确的工具集来编译其源代码,这会派上用场。



API consideration

API考虑

As the GitHub V3 Release APIillustrates, a release is nota tag.
When you create a release, you would need the name of a tag, but that would create an emptyrelease (associated to that tag)

正如GitHub V3 发布 API所示,发布不是标签。
当你创建一个版本,你需要一个标签的名字,但是这将创建一个空的释放(关联到标签)

From a release, you can upload one or more assets to it.

从发布中,您可以将一个或多个资产上传到其中

The asset data is expected in its raw binary form.

资产数据应为原始二进制形式。

POST https://<upload_url>/repos/:owner/:repo/releases/:id/assets?name=foo.zip


Note: GitLab also supports "release" since GitLab 8.2 (Nov. 2015).

注意:GitLab自 GitLab 8.2 (Nov. 2015) 起也支持“发布” 。