git commit 时出现:please enter the commit message for your changes
每次准备提交前,先用 git status 看下,是不是都已暂存起来了,然后再运行提交命令 git commit:
$ git commit
这种方式会启动文本编辑器以便输入本次提交的说明。(默认会启用 shell 的环境变量 $EDITOR 所指定的软件,一般都是 vim 或 emacs。当然也可以按照第一章介绍的方式,使用 git config --global core.editor 命令设定你喜欢的编辑软件。)
编辑器会显示类似下面的文本信息(本例选用 Vim 的屏显方式展示):
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: README
# modified: benchmarks.rb
~
~
~
".git/COMMIT_EDITMSG" 10L, 283C
可以看到,默认的提交消息包含最后一次运行 git status 的输出,放在注释行里,另外开头还有一空行,供你输入提交说明。你完全可以去掉这些注释行,不过留着也没关系,多少能帮你回想起这次更新的内容有哪些。(如果觉得这还不够,可以用 -v 选项将修改差异的每一行都包含到注释中来。)退出编辑器时,Git 会丢掉注释行,将说明内容和本次更新提交到仓库。
如果要输入解释的话就需要:
1.按键盘字母 i 进入insert模式
2.修改最上面那行黄色合并信息,可以不修改
3.按键盘左上角"Esc"
4.输入":wq",注意是冒号+wq,按回车键即可
也可以使用 -m 参数后跟提交说明的方式,在一行命令中提交更新。即:git commit -m "这里是信息",添加就不会出现提示了
git commit 时出现:please enter the commit message for your changes的更多相关文章
- git中Please enter a commit message to explain why this merge is necessary.
Please enter a commit message to explain why this merge is necessary. 请输入提交消息来解释为什么这种合并是必要的 git 在pul ...
- git提示Please enter a commit message to explain why this merge is necessary
Please enter a commit message to explain why this merge is necessary. 请输入提交消息来解释为什么这种合并是必要的(提交信息) gi ...
- 项目git commit时卡主不良代码:husky让Git检查代码规范化工作
看完 <前端规范之Git工作流规范(Husky + Commitlint + Lint-staged) https://www.cnblogs.com/Yellow-ice/p/15349873 ...
- git 使用详解(4)—— commit -a -m/diff --staged/rm/mv
查看已暂存和未暂存的更新 实际上 git status的显示比较简单,仅仅是 列出了(修改过的.新创建的.已经暂存但未提交的)文件,如果要查看具体修改了什么地方,可以用git diff 命令.稍后我们 ...
- Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty messa
1.git提交的时候遇到: # Please enter the commit message for your changes. Lines starting with '#' will be ig ...
- git移除上一次的commit中误添加的文件
在使用git进行版本管理时,往往会出现一些误操作,比如将一些不加上传的文件放到了暂存区,即上传到了上一次commit中 比如: commit c134ab90ca7c4daf8bfa22e3ad706 ...
- Please enter a commit message to explain why this merge is necessary.
Please enter a commit message to explain why this merge is necessary. 请输入提交消息来解释为什么这种合并是必要的 git 在pul ...
- svn 中commit时必须填写备注信息如何设置
在软件开发团队中总是有人忘记添加备注信息,可以通过下面方式进行设置,从而在commit时强制需要填写备注信息. 在服务端选中需要设置的项目进行设置. 选中项目右键,"所以任务"-& ...
- git将多个commit合并成一个新的commit
问题: 有以下commit: 323udd ede234 6e7s6e 要合并第一个和第二个commit 方法有二: 方法一 使用git rebase -i hash-id,-i表示以交互模式进行co ...
随机推荐
- HTML5的placeHolder在IE9下workaround引发的Bug(按下葫芦起了瓢)
详见StackOverFlow的:Simple jQuery form Validation: Checking for empty .val() failing in ie9 due to plac ...
- Java使用HTTPClient4.3开发的公众平台消息模板的推送功能
代码引用,参考文章:http://www.cnblogs.com/feiyun126/p/4778556.html,表示感谢! package com.yuanchuangyun.cyb.manage ...
- js选择排序。
<script> , , , , , , , ]; ; j<len; j++ ){ // 假设min为最小值 var minIndex = j; var min = arr[j]; ...
- GIL全局解释器锁+GIL全局解释器锁vs互斥锁+定时器+线程queue+进程池与线程池(同步与异步)
以多线程为例写个互斥锁 from threading import Thread ,Lockimport timemutex = Lock() n = 100 def task(): global n ...
- linux bin & sbin different
linux bin & sbin different flutter & $PATH http://blog.taylormcgann.com/2014/04/11/differenc ...
- 深入理解CSS绝对定位absolute
前面的话 前面已经介绍了定位的偏移和层叠,例子中大量的应用了绝对定位.因为相较于相对定位和固定定位,绝对定位在实际中应用频率更高.应用场景更广泛.本文将介绍使用绝对定位时的具体细节 定义 当元素绝对定 ...
- 【Linux】Centos6.8下一键安装Lnmp/Lamp环境
[下载一键安装软件包] 百度云地址:https://pan.baidu.com/s/1TZqGKtE-46gxW96Ptfp4gA 网址:https://lnmp.org/ [步骤] 通过第三方远程工 ...
- 【POI每日题解 #5】 DWU-Double-row
题目链接 [POI2005]DWU-Double-row wwwww 之前写了半小时 一卡机 没啦QAQ 简单说一下吧 [吐血ing 这道题长得好二分图啊 所以本能地连边 一种是A边 连可交换的数对 ...
- Leetcode 326.3的幂 By Python
给定一个整数,写一个函数来判断它是否是 3 的幂次方. 示例 1: 输入: 27 输出: true 示例 2: 输入: 0 输出: false 示例 3: 输入: 9 输出: true 示例 4: 输 ...
- 洛谷 P3299 [SDOI2013]保护出题人 解题报告
P3299 [SDOI2013]保护出题人 题目描述 出题人铭铭认为给SDOI2012出题太可怕了,因为总要被骂,于是他又给SDOI2013出题了. 参加SDOI2012的小朋友们释放出大量的僵尸,企 ...