Git 和变更日志指南

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

Git and changelog guideline

gitmarkdownbitbucketchangelog

提问by redmile

I'm a noobwith git and i would like to know the best practice to create tags and generate/mantain a changelog.

我是git的菜鸟,我想知道创建标签和生成/维护变更日志的最佳实践。

Until now, i always created a readme.md and manually indicate (in the section "changelog") the most important feature

到现在为止,我总是创建一个 readme.md 并手动指出(在“更改日志”部分)最重要的功能

For example:

例如:

version 1.0.1

  • changed layout in home
  • added slideshow in gallery
  • etc..

版本 1.0.1

  • 改变了家里的布局
  • 在画廊中添加幻灯片
  • 等等..

How can i create a changelog (maybe in markdown format) with these characteristics?

我如何创建具有这些特征的变更日志(可能是降价格式)?

  • title of changes based on personalized title/tags title/date
  • changes based on tags or commits
  • 基于个性化标题/标签标题/日期的更改标题
  • 基于标签或提交的更改

I do not have a clear idea yet, so suggestions are aprreciate

我还没有一个明确的想法,所以建议是aprreciate

Thanks in advance :)

提前致谢 :)

采纳答案by skywinder

There are no some common guidelines yet. But a lot of good rules are explained on keep a changelog.

目前还没有一些通用的指导方针。但是在keep a changelog上解释了很多好的规则。

And as they mention:

正如他们所提到的:

Don't let your friends dump git logs into changelogs.

不要让您的朋友将 git 日志转储到变更日志中。

And I fully agree with it.

我完全同意。

That's why I created GitHub Changelog Generatorthat generates a changelog according all these guidelines.

这就是我创建GitHub Changelog Generator的原因,它可以根据所有这些指南生成变更日志。

Actually it works with GitHub only, but it present a good example of how a changelog should look like.

实际上它只适用于GitHub,但它提供了一个很好的例子来说明变更日志的外观。

It automatically generates a changelog from your tags, issues, labels and pull requests.

它会根据您的标签、问题、标签和拉取请求自动生成变更日志。

For example: This changelog was generated by this script: CHANGELOG.md

例如:这个变更日志是由这个脚本生成的:CHANGELOG.md

Changelog

1.2.5(2015-01-15)

Full Changelog

Implemented enhancements:

  • Use milestone to specify in which version bug was fixed #22

Fixed bugs:

  • Error when trying to generate log for repo without tags #32

Merged pull requests:

  • PrettyPrint class is included using lowercase 'pp' #43(schwing)

  • support enterprise github via command line options #42(glenlovett)

变更日志

1.2.5(2015-01-15)

完整更新日志

已实现的增强功能:

  • 使用里程碑指定修复了哪个版本的错误#22

修正错误:

  • 尝试为没有标签的 repo 生成日志时出错#32

合并拉取请求:

  • 使用小写的“pp” #43( schwing)包含 PrettyPrint 类

  • 通过命令行选项#42( glenlovett)支持企业 github

回答by jurglic

I suggest you still manually describe the changes in the changelog.

我建议您仍然手动描述更改日志中的更改。

Tough, you can link to a generated changes via github diff. For example, the changelog: https://github.com/rspec/rspec-core/blob/master/Changelog.md

很难,您可以通过 github diff 链接到生成的更改。例如,变更日志:https: //github.com/rspec/rspec-core/blob/master/Changelog.md

And the diff: https://github.com/rspec/rspec-core/compare/v2.14.2...master

和差异:https: //github.com/rspec/rspec-core/compare/v2.14.2...master

You may want to look around in the repositories of some other reference opensource projects where a lot of good practices can be found.

您可能想在其他一些参考开源项目的存储库中四处看看,在那里可以找到很多好的做法。

回答by rderoldan1

Probably my Asnwer is too late, but now I'm using a amazing ruby gem, it read your git log and split by tags, and the output is written in markdown, take a look

可能我的 Asnwer 来得太晚了,但现在我使用了一个惊人的 ruby​​ gem,它读取你的 git 日志并按标签拆分,输出是用 Markdown 写的,看看

https://github.com/kebab-project/katip

https://github.com/kebab-project/katip