编写良好的 git 提交信息
来源:互联网 发布:淘宝上的aj是正品吗 编辑:程序博客网 时间:2024/06/11 08:31
编写一个良好的 git 提交信息
提交信息
我们作一次提交,都会提交相关的修改信息,一般这些信息当时都会仔细考虑留下应该留下的那些重要信息,比如为什么需要这次提交,提交解决什么问题等。
而且我们需要好好组织这些信息,一边以后查看,因为这些跟代码一样重要,他们是历史,就像课本一样,一旦留下错误的信息或者难以理解的信息,将会对
后来者,产生非常多的麻烦。
提交信息规范
一般来说,提交信息没有什么强制性的规范,但是希望大家遵循一些基本的规则,这些规则有利于大家正确表达提交内容,留下重要的信息,而忽略那些不必要
的内容。
实例
https://github.com/torvalds/subsurface
编写一个良好的提交信息:
Also, please write good git commit messages. A good commit messagelooks like this: Header line: explain the commit in one line (use the imperative) Body of commit message is a few lines of text, explaining thingsin more detail, possibly giving some background about the issuebeing fixed, etc etc. The body of the commit message can be several paragraphs, andplease do proper word-wrap and keep columns shorter than about74 characters or so. That way "git log" will show thingsnicely even when it's indented. Make sure you explain your solution and why you're doing what you'redoing, as opposed to describing what you're doing. Reviewers and yourfuture self can read the patch, but might not understand why aparticular solution was implemented. Reported-by: whoever-reported-itSigned-off-by: Your Name <youremail@yourhost.com> where that header line really should be meaningful, and really should bejust one line. That header line is what is shown by tools like gitk andshortlog, and should summarize the change in one readable line of text,independently of the longer explanation. Please use verbs in theimperative in the commit message, as in "Fix bug that...", "Addfile/feature ...", or "Make Subsurface..." 一次良好的提交信息应该包含一个信息头,尽量用一行文字总结那些必要信息然后空下一行,
接着写下关于这次提交的具体内容,有关修复bug的背景等等,尽量表达你为什么
要做这次提交而不是你正在作什么提交。这样被人才能很好的理解而不会弄不清楚
为什么需要这个东西。所有的提交内容保持在74个字符之内,这样才能被 git log
正常的显示,而不会超过屏幕。
下面是一些: 提交者信息,或者其他信息,一般都是 git 里面需要的代码编写者或者
测试者名字和邮箱,具体参考 git 。
3 0
- 编写良好的 git 提交信息
- 规范git的提交信息
- git修改已经提交的commit信息
- Git 修改提交信息
- Git 修改提交信息
- Git 提交的正确姿势:Commit message 编写指南
- Git 提交的正确姿势:Commit message 编写指南
- 养成良好的labview程序编写习惯
- 以良好的方式编写C++ class
- Git 提交信息样式指南
- Git 提交信息样式指南
- AngularJS Git提交信息规范
- 用vim来写GIT的提交信息
- Git下修改提交的author和email信息
- 在android的内核启动信息中添加git提交信息
- 编写自动提交留言信息程序
- git 全局配置 查看详细提交信息
- git提交代码,账号信息为他人
- Eclipse Android工程一些技巧
- Tomcat源码解析1:Eclipse导入Tomcat源代码
- Spinner 用法,标题可以显示
- Arrays
- 控件看不见或者看得见不能点击的原因小结
- 编写良好的 git 提交信息
- 关于用连续用多个scanf函数输入数据时前面的scanf函数会在缓冲区留下回车符的问题
- 如果看了此文你还不懂傅里叶变换,那就过来掐死我吧【完整版】
- 解析C++转换构造函数(调用规则)
- 脚本创建(选择结构和循环结构)
- 真正统治世界的十大算法
- Lua和C之间的交互【转】
- C# GC垃圾自动回收(陷阱)
- MySql启动出错:server quit without updating PID file (/usr/local/mysql/mysql.pid)