atom 中首次使用git_使用Atom获得更好的Git提交消息
atom 中首次使用git
by Hasit Mistry
通过Hasit Mistry
使用Atom获得更好的Git提交消息 (Get Better Git Commit Messages with Atom)
Recently, I came across two enlightening posts about writing better Git commit messages. These posts give suggestions about how a well structured commit message should look like, and provide clear examples.
最近,我遇到了两个有关编写更好的Git提交消息的启发性文章。 这些帖子提供了有关结构良好的提交消息外观的建议,并提供了清晰的示例。
Better Commit Messages with a .gitmessage Template by Matthew Summer
使用 Matthew Summer 的.gitmessage模板更好地提交消息
How to Write a Git Commit Message by Chris Beams
如何编写 Chris Beams 的Git提交消息
These two blog posts made me go back to my repositories and read my commit messages. And to be honest, I felt a little ashamed of my past then.
这两个博客文章使我返回到存储库并阅读了提交消息。 老实说,那时我对自己的过去感到有些ham愧。
You may ask, “why are commit messages even important?” If you find yourself asking that question, you are like the one-week-younger version of me.
您可能会问,“为什么提交消息甚至很重要?” 如果您发现自己在问这个问题,那就像是我一个星期的孩子。
Just to give you an idea, Figure 1 shows some of the commit messages from my project licensethis. I promise that the code is much better than the commit messages.
为了给您一个想法,图1显示了我的项目licensethis中的一些提交消息。 我保证代码比提交消息要好得多。
It’s unsurprising how little these commit messages actually tell me about my past work. That’s because I didn’t take writing them seriously.
这些提交消息实际上告诉我有关我过去的工作的信息不足为奇。 那是因为我没有认真对待它们。
In order to actually understand which changes each commit contributed, I had to go into each commit and read the changes line-by-line. This is tedious to say the least.
为了真正了解每个提交所做的更改,我必须进入每个提交并逐行阅读更改。 至少可以说这很乏味。
At the time of authoring these commit messages, I invariably blurted out whatever made sense to me at that moment, with no consideration of how I — or anyone else for that matter — would understand the text at a later stage.
在编写这些提交消息时,我总是脱口而出当时对我有意义的任何内容,而没有考虑我-或其他人在以后的阶段将如何理解文本。
First, let’s synthesize all the information we’ve absorbed from the above-mentioned blog posts. Then I’ll give working tips on how Atom can be used as a tool for writing better commit messages for myself and others who are interested in doing the same.
首先,让我们综合从上述博客文章中吸收的所有信息。 然后,我将提供一些工作提示,说明如何将Atom用作为自己和其他有兴趣这样做的人编写更好的提交消息的工具。
Note that I am not going to write about how to write a good commit message. Chris Beams’s wonderful post on How to Write a Git Commit Message explains just that and more in seven rules.
请注意,我不会写有关如何编写好的提交消息的文章。 克里斯·比姆斯 ( Chris Beams )在有关如何编写Git提交消息的精彩文章中,用七个规则对此进行了解释。
Before we begin, let us look at this following text block to understand what is considered as a properly-structured, purposeful, and well-written commit message:
在开始之前,让我们看一下下面的文本块,以了解什么被认为是结构正确,有目的且写得很好的提交消息:
# Subject in (preferably) less than 50 charactersThis is the subject of this commit message
# Body in greater detailThis is the body of this commit message. The body is written after the subject line with one blank line in between. The blank line is used by various tools (such as 'git log', 'git show', etc.) to differentiate subject from body. Further paragraphs are also separated by blank lines.
Explain the problem being solved by this commit. More importantly, explain why these changes are being made, as opposed to how. The 'why' part is your responsibility, the 'how' part is code's responsibility.
- You can also use bullets like this.- Or, like this.
Some great examples of such commit messages can be found over at the Linux and Git repositories on GitHub.
可以在GitHub上的Linux和Git存储库中找到此类提交消息的一些很好的示例。
Now, it is understandable that not every commit brings big changes to the repository. Some commits would be for fixing typos, and others for changing line order or indentation. In such cases, a subject line by itself should suffice.
现在,可以理解的是,并非每次提交都会对存储库带来重大变化。 一些提交用于修复错别字,而其他提交则用于更改行序或缩进。 在这种情况下,主题行本身就足够了。
Atom is a text editor that I use for everything! I use it to take notes in class, complete writing assignments in Markdown (unless I absolutely require the super powers of MS Word), and for programming projects on a daily basis.
Atom是我用于所有操作的文本编辑器! 我用它在课堂上做笔记,在Markdown中完成写作作业(除非我绝对需要MS Word的超级能力),以及用于日常项目编程。
I keep tweaking Atom little-by-little every time I learn something new, it’s fun to watch my config files slowly grow in size.
每次学习新知识时,我都会不断地对Atom进行微调,很有趣的一点是,我的配置文件的大小逐渐变大。
So let us start by setting Atom as our default commit editor for git, and checking if the same has happened correctly using the following commands in your terminal:
因此,让我们从将Atom设置为git的默认提交编辑器开始,并使用以下命令在终端中检查是否正确发生了该操作:
git config --global core.editor "atom --wait"
git config --get core.editor
# Which should give you the output: atom --wait
根据其长度更改主题线的颜色 (Change the color of the subject line according to its length)
First, we will set up Atom so that it changes the color of the subject line to orange if the length exceeds 50 characters and to red if the length exceeds 65 characters. You can read more about git integrations for Atom at Git Integration.
首先,我们将设置Atom,以便如果长度超过50个字符,则将主题行的颜色更改为橙色,如果长度超过65个字符,则将其更改为红色。 您可以在Git Integration上了解有关Atom的git集成的更多信息。
Open up your Atom’s styles.less file, which is under the “Atom” menu option:
打开您的Atom的styles.less文件,该文件位于“ Atom”菜单选项下:
Write the following lines of code into Atom’s styles.less file:
将以下代码行写入Atom的styles.less文件中:
atom-text-editor::shadow { .git-commit.invalid.deprecated.line-too-long { color: @text-color-warning; text-decoration: none; }
.git-commit.invalid.illegal.line-too-long { color: @text-color-selected; background: @background-color-error; opacity: 0.9; }}
Once you’ve made the changes and saved the file, Atom will behave as shown in Figure 2.
进行更改并保存文件后,Atom的行为将如图2所示。
编写用于提交消息结构的代码段 (Write a snippet for commit message structure)
Second, we will write a short snippet for commit messages. This snippet will provide placeholders for subject line and body that can be navigated using TAB key.
其次,我们将为提交消息编写一个简短的代码段。 此摘要将提供主题行和正文的占位符,可以使用TAB键进行导航。
Write the following lines of code into Atom’s snippets.cson:
将以下代码行写入Atom的snippets.cson:
'.text.git-commit': 'commit-message': 'prefix': 'comm' 'body': """ ${1:Subject < 50 chars}
${2:Body in detail} """
After you make the changes and save the snippets file, the next time you open your commit message, you just need to type comm and press TAB to expand your snippet.
进行更改并保存摘录文件后,下次打开提交消息时,只需键入comm并按TAB键即可扩展摘录。
Once the snippet has been expanded, you can press TAB again to jump the cursor from ‘subject line’ to ‘body’. Figure 3 shows this snippet in action.
扩展代码段后,您可以再次按TAB键将光标从“主题行”跳转到“正文”。 图3显示了该片段的运行情况。
These little code snippets have sure improved my git commit workflow, and I’m confident they can improve yours.
这些小代码段确实改善了我的git commit工作流程,并且我相信它们可以改善您的git commit工作流程。
If you have any other committing-related snippets that you use in Atom, please be sure to post them. I’d love to have a look and maybe incorporate them into my workflow.
如果您在Atom中使用其他任何与提交相关的摘要,请确保将其发布。 我很想看看,也许可以将它们合并到我的工作流程中。
Also — for those curious — here’s a list of themes and packages I’ve used in the above figures:
另外-对于那些好奇的人-这是我在上图中使用的主题和包的列表:
UI Theme — Nucleus Dark
UI主题— 暗核
Syntax Theme — Atom Dark Fusion
语法主题— Atom Dark Fusion
Git editing support for Atom — language-git
对Atom的Git编辑支持— language-git
翻译自: https://www.freecodecamp.org/news/towards-better-git-commit-messages-using-atom-6dbda5e14984/
atom 中首次使用git
相关文章:

正确理解ThreadLocal
详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcyt107 首先,ThreadLocal 不是用来解决共享对象的多线程访问问题的,一般情况下,通过ThreadLocal.set() 到线程中的对象是该线程自己使用的对象,其他线程…

PHP-密码学算法及其应用-对称密码算法
转自:http://www.smatrix.org/bbs/simple/index.php?t5662.html //目录1. PHP的散列函数及其应用2. PHP中的对称密码算法及其应用3. PHP的公钥密码算法及其应用///2 PHP中的对称密码算法及其应用前一段时间一直想写完PHP中的密码学算法及其应用的三大部分…

Swift4 String截取字符串
var str1 "AlexanderYeah";// 1 截取字符串的第一种方式 // prefix 截取前3个字符串 var str2 str1.prefix(3); print(str2);// suffix 截取后3个字符串 var str3 str1.suffix(3); print(str3);// 2 截取一个范围的字符串 // 从0开始 到倒数第二位结束 let idx1 …

angular react_Angular 2 vs React:将会有鲜血
angular reactAngular 2 has reached Beta and appears poised to become the hot new framework of 2016. It’s time for a showdown. Let’s see how it stacks up against 2015’s darling: React.Angular 2已达到Beta版本,并有望成为2016年炙手可热的新框架。该…

Welcome to Swift (苹果官方Swift文档初译与注解三十四)---241~247页(第五章-- 函数)
In-Out Parameters (全局参数) 像前面描述的参数变量,只能在函数体内进行修改,如果你需要函数修改的它的参数值,并且希望这些改变在函数调用结束后仍然有效,可以定义使用全局参数. 定义全局参数使用关键字inout,全局参数的值在函数调用的时候进行传递,在函数体内进行修改,最后函…

递归 尾递归_代码简报:递归,递归,递归
递归 尾递归Here are three stories we published this week that are worth your time:这是我们本周发布的三个值得您关注的故事: A beginner’s guide to recursion: 6 minute read 递归初学者指南: 6分钟阅读 Things you probably didn’t know you …

Hadoop 生态系统
当下 Hadoop 已经成长为一个庞大的生态体系,只要和海量数据相关的领域,都有 Hadoop 的身影。下图是一个 Hadoop 生态系统的图谱,详细列举了在 Hadoop 这个生态系统中出现的各种数据工具。这一切,都起源自 Web 数据爆炸时代的来临。…

socket通信——通过Udp传输方式,将一段文字数据发送出去
需求:通过Udp传输方式,将一段文字数据发送出去定义一个Udp发送端思路:1、建立updsocket服务2、提供数据,并将数据封装到数据包中。3、通过socket服务的发送功能,将数据包发出去4、关闭资源。import java.net.*; class …

编码中统一更该变量的快捷键_流媒体的7种方式使您成为更好的编码器
编码中统一更该变量的快捷键by freeCodeCamp通过freeCodeCamp 流媒体的7种方式使您成为更好的编码器 (7 Ways Streaming Makes you a Better Coder) After coding live on twitch.tv for dozens of hours, I’m convinced that streaming makes you a better coder. Here’s w…

AutoConfig工具使用
下载安装Auto工具包: http://code.taobao.org/mvn/repository/com/alibaba/citrus/tool/antx-autoconfig/1.0.9/antx-autoconfig-1.0.9.tgzhttp://code.taobao.org/mvn/repository/com/alibaba/citrus/tool/antx-autoexpand/1.0.9/antx-autoexpand-1.0.9.tgztar zxv…

Spark2 ML 学习札记
摘要: 1.pipeline 模式 1.1相关概念 1.2代码示例 2.特征提取,转换以及特征选择 2.1特征提取 2.2特征转换 2.3特征选择 3.模型选择与参数选择 3.1 交叉验证 3.2 训练集-测试集 切分 4.spark新增SparkSession与DataSet 内容: 1.pipeline …

xCode 开发快捷键
Ctrl CMD 右箭头返回上一个编辑的界面Ctrl CMD 左箭头返回后一个编辑的界面CMD Option 左箭头区域代码折叠CMD Option 右箭头区域代码展开Shift CMD Option 左箭头折叠界面内所有的代码Shift CMD Option 右箭头展开界面内所有的代码CMD Ctrl 上下箭头.h 和 .m …

javascript模块_JavaScript模块第2部分:模块捆绑
javascript模块by Preethi Kasireddy通过Preethi Kasireddy JavaScript模块第2部分:模块捆绑 (JavaScript Modules Part 2: Module Bundling) In Part I of this post, I talked about what modules are, why developers use them, and the various ways to incorp…

idea上实现github代码同步
1.先将github远程仓库clone到本地 2.将本地仓库中的项目导入到idea中 3.如果你的项目代码不是放在仓库的根目录下,idea会识别到你的项目是在git仓库目录下,必须点击add root才能匹配路径。 4.add root后会发现右击项目时会多了一个git选项 5.在git选项中…

iOS12 UITabbar Item 向上漂移错位的bug
[[UITabBar appearance] setTranslucent:NO]; 加此行代码 完美解决此bug

jQuery学习笔记(一)
补充一些自己容易忘的知识点: event.stopPropagation() 阻止事件冒泡 event.preventDefault() 阻止事件的默认行为 return false 相当于event.stopPropagation() event.preventDefault() 。除了阻止默认行为之外,还会阻止事件冒泡。 转载于:https://www.cnblogs.…

随机网络构建_构建随机报价机
随机网络构建by Ayo Isaiah通过Ayo Isaiah 构建随机报价机 (Building a Random Quote Machine) I really wasn’t entirely satisfied with my first attempt at building a Random Quote Generator on Free Code Camp. It was ugly, and the quotes were too long, so I didn…

20145231 《信息安全系统设计基础》第11周学习总结
20145231《信息安全系统设计基础》第11周学习总结 教材学习内容总结 异常 异常是异常控制流的一种形式,由硬件和操作系统实现。简单来说,就是控制流中的突变。 出现异常的处理方式: 1.处理器检测到有异常发生 2.通过异常表,进行间…

JAR命令使用
jar 命令详解 jar 是随 JDK 安装的,在 JDK 安装目录下的 bin 目录中,Windows 下文件名为 jar.exe,Linux 下文件名为 jar。它的运行需要用到 JDK 安装目录下 lib 目录中的 tools.jar 文件。不过我们除了安装 JDK 什么也不需要做,因…

捍卫者usb管理控制系统_捍卫超模块化JavaScript
捍卫者usb管理控制系统by Mike Groseclose通过Mike Groseclose 捍卫超模块化JavaScript (In Defense of Hyper Modular JavaScript) Last week npmgate was a big topic for the JavaScript community. For those of you who haven’t been following what happened, here’s …
Android开发——布局性能优化的一些技巧(一)
0. 前言上一篇我们分析了为什么LinearLayout会比RelativeLayout性能更高,意义在于分析了这两种布局的实现源码,算是对一个小结论的证明过程,但是对布局性能的优化效果,对这两种布局的选择远不如减少布局层级、避免过分绘制、按需加…

1-RAC基础
1 安装 pod ‘ReactiveObjC’ RAC 其实大大减少了代码量 2 基本使用 // 0 RAC 中最为常见的类 信号类/*RACSignal:信号类1.通过RACSignal 创建1个信号(默认:冷信号)2.通过订阅者,订阅信号信号(变成:热信号…

static用法总结
C的static有两种用法:面向过程程序设计中的static和面向对象程序设计中的static。前者应用于普通变量和函数,不涉及类;后者主要说明static在类中的作用。 一、面向过程设计中的static1、静态全局变量2、静态局部变量3、静态函数二、面向对象的…

小程序 缩放_缩放流星应用程序的初体验
小程序 缩放by Elie Steinbock埃莉斯坦博克(Elie Steinbock) 缩放流星应用程序的初体验 (First Experiences Scaling a Meteor App) I recently went through the challenge and ordeal of having to scale my Meteor app. It’s a project that had already been running in …

SQL Server Lock Escalation - 锁升级
Articles Locking in Microsoft SQL Server (Part 12 – Lock Escalation) http://dba.stackexchange.com/questions/12864/what-is-lock-escalation 2008 R2 Lock Escalation (Database Engine)---Forward from Locking in Microsoft SQL Server (Part 12 – Lock Escalation)…

Jzzhu and Chocolate
CF#257 div2 C:http://codeforces.com/contest/450/problem/C 题意:n*m的方格,每次可以横着或者纵向的切一刀,问切k之后,最小的最大是多少。 题解:比赛的时候没有想到怎么处理,看了别人的题解,才…

2-RACommand
RACommand RACCommand 就是命令 // RACCommand 就是命令// 0 创建一个CMD 穿进去一个用于构建RACSignal的Block参数来初始化RACommandRACCommand *cmd [[RACCommand alloc]initWithSignalBlock:^RACSignal * _Nonnull(id _Nullable input) {// 此处是cmd 执行的输入源NSLog(…

玻璃上的编码喜悦(+ 10史诗般的Epigrams)
by Den McHenry丹麦克亨利(Den McHenry) 玻璃上的编码喜悦( 10史诗般的Epigrams) (Perlis on Coding Joy ( 10 Epic Epigrams)) Alan J. Perlis was the first recipient of the Turing Award. He’s possibly most remembered today for his Epigrams on Programming, which …

【Android】Activity生命周期(亲测)
测试手机:Nexus 5 系统:4.4 一、测试 测试代码: 1 package com.example.androidalarm;2 3 import android.app.Activity;4 import android.content.Context;5 import android.content.res.Configuration;6 import android.os.Bundle;7 impo…

angularjs 学习笔记 简单基础
angularjs是谷歌公司的一个项目,弥补了hml在构建方面的不足,通过指令(directive)来扩展html标签,可以使开发者使用html来声明动态内容。 angularjs主要用来开发单页应用(SPA)为主的项目。 angul…