GitHub 时程与版本管理 - Milestone, Tag 与 Release

在这一篇文章,我们要来谈,GitHub 中另外几个进阶的功能: Milestone (里程碑)、Tag (标签) 与 Release (新版本),可以协助我们管理专案、程序码与产品。首先,我们先来谈谈 Milestones,从字面上的解释是:展示目前位置与目的地之间的距离,在专案管理中则表示阶段性可交付的内容,用来衡量进度 (参考资料 wiki:里程碑)

在 GitHub Issue 内的 Milestone 具有下列功能

  1. 在主要的时间点上追踪进度
  2. 相同类型的 Issue 群组化
  3. 作为处理得优先顺序依据

你可以在 Issues 功能画面中找到 Milestone

https://ithelp.ithome.com.tw/upload/images/20210905/20091494JvpQ5bYwrD.png

点选右边 New milestone 按钮
https://ithelp.ithome.com.tw/upload/images/20210905/20091494gFQ6p8F637.png

输入 Title, Due date(截止日期), 与 Description,完成後点选右下角 Create milestone
https://ithelp.ithome.com.tw/upload/images/20210905/20091494YFghJlxk9C.png

完成设定後,你可以看见建立好的 milestone 与其状态 (0% Complate, 0 open, 0 closed)
https://ithelp.ithome.com.tw/upload/images/20210905/20091494CRiTlUfmA9.png

理所当然,我们需要将 issue 连结到此 milestone,才会有正确的统计数字。回到 issue 画面,点选我们在上一篇文章所建立的 issue: Create GitHub Page (文章连结:在 GitHub 上讨论议题 - 建立第一个 Issue 与自订 Labels),在画面右手边将此 issue 加入 milestone。

https://ithelp.ithome.com.tw/upload/images/20210905/20091494z8QGP4WXFK.png

回到 Milestone 画面,即可看见 1 open 字样,我们完成了 "将 issue 加入 milestone" 工作
https://ithelp.ithome.com.tw/upload/images/20210905/20091494MkWxfY3EXH.png


接下来,我们来谈谈 Tag 与 Release...

Tag 通常在历史纪录中,注记重要的节点,并且在 GitHub 上提供 Zip/Tar 原始档案下载。 Tag 常见的使用方式像是版本管理 (v1.0 或 Release1.2)。对於频繁更新与修复的软件/服务,Tag 是非常重要的功能。 Tag 可以在目前的 commit 上加入,也可以後续再加入。Tag 大致上可以分两类:

  • Lightweight (轻量级标签)
  • Annotated (有注解的标签)

在这里,需要有一些的 Git 指令使用经验。在本篇文章,我们只简易说明如何使用 Tag,不再细部 Git 相关功能,若您有兴趣可以参考:Git 基础-标签

你可以在命令列使用 git tag 检视所有的 Tag (但因为我们的范例专案尚未建立任何 Tag,所以会是空白的)
git tag
https://ithelp.ithome.com.tw/upload/images/20210905/20091494XmjMe5FJp9.png

你可以透过 git log --oneline --graph --decorate --all 检视更改纪录。黄色字部分即为 commit hash id
https://ithelp.ithome.com.tw/upload/images/20210905/20091494ney4gE8BGv.png

你可以使用下列指令,对於特定 commit 建立 Tag
指令格式:git tag -a [版本] -m "[版本讯息]" [commit hash id]
指令范例:git tag -a v0.1 -m "0.1 release" 990e0bd
https://ithelp.ithome.com.tw/upload/images/20210905/20091494mYPXTaAZ3G.png

重新使用 git tag 检视纪录
https://ithelp.ithome.com.tw/upload/images/20210905/20091494b6dowQ3NIa.png

确认没问题,将 tag 推上 github,指令为 git push origin --tags (将所有标签推送上去)
https://ithelp.ithome.com.tw/upload/images/20210905/200914947zvIJwjMJC.png

您可以开启 GitHub 上你的 Repo,即可看见上方 Tag 数量有增加
https://ithelp.ithome.com.tw/upload/images/20210905/20091494QpBfpSaAxM.png

GitHub 上 Tag 功能可以让您直接下载此版本的原始程序 (Zip/Tar格式)
https://ithelp.ithome.com.tw/upload/images/20210905/20091494g2AZlM01Le.png

https://ithelp.ithome.com.tw/upload/images/20210905/20091494LoIO6sUNVG.png


Release 即为释出的正式版,是 DevOps 中重要的程序,属於交付工作。在 GitHub Release 功能中,使用者可以下载原始程序码与可执行程序 (binary file)。在建立 Release 时,必须注意:

  1. 此功能必须建立在 Tag 上
  2. 释出的新版本必须选择Tag
  3. 需要加入 Release note
  4. 上传可执行的程序 (Binary file)

在 Repo 画面,我们点选右边 Create release
https://ithelp.ithome.com.tw/upload/images/20210905/20091494PFhz75hWPJ.png

选择 Tag,输入名称与描述,上传可执行档案,完成後点选下方 Publish release 按钮即完成发布新版本

https://ithelp.ithome.com.tw/upload/images/20210905/20091494mNRysKqLKk.png

https://ithelp.ithome.com.tw/upload/images/20210905/200914940bHCgoTcnn.png


经过本篇文章,你应该对於 GitHub 中 Milestone, Tag, 与 Release 功能有完整的了解。经过前面这五篇文章对 GitHub 基本的介绍,从下一篇文章开始,我们将要正式开始进入 GitHub DevOps 主题,内容包含 Development, Project, Action workflow(CI/CD), Security 与实际案例分享。


<<:  5.unity图片分割(Slice Sprite)、tile绘制技巧

>>:  关於URL encode

Day 24:如何还原备份到 Github 另外一个分支的 Hexo 资料?

昨天我们尝试将 Hexo 备份到储存库另外一个分支,但如果哪一天真正需要使用这个备份还原本机环境怎麽...

聊招募前,先问问你了解自己吗?

成为公司的一份子大都是经由招募流程而加入的,但某一天团队需要扩大或是人手不足,而你刚好有机会可以参与...

[Day29]-使用python处理pdf档案

基础 使用时要先下载pip install PyPDF2 读取Pdf页面内容 检查Pdf是否被加密...

DAY22 - [React] 资料夹结构概述

今日文章目录 资料夹结构概述 参考资料 今天写一点我对 React资料结构的基础了解,在写Reac...

[NestJS 带你飞!] DAY27 - Swagger (下)

API 操作设计 上一篇我们让 API 的参数能够顺利显示在 Swagger UI 中,在设计完参数...