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 ...
随机推荐
- git忽略本地文件
一.忽略文件的常用方法 1.git通常在.gitignore文件进行配置,来忽略本地文件.但是这仅对于重来没有提交过的文件有效. 2.使用git update-index --skip-worktre ...
- error launching installer-最新版Win 10 解决方案
error 提示 error launching installer遇到 error的背景 楼主最近重新装了Windows 10 pro 64 bit 版,安装的时候选的地区是United State ...
- Jquery 组 表单验证
<!DOCTYPE html><html lang="zh-cn"><head> <meta charset="utf-8&qu ...
- Java微信二次开发(七)
自定义菜单 第一步:新建包com.wtz.menu,新建类Button.java package com.wtz.menu; /** * @author wangtianze QQ:864620012 ...
- Java之枚举举例
package enumdemo; /** * 枚举类 */ public enum MAPPER { // 实例 ELEMENT_NAME("mapper"), ATTRIBUT ...
- python之FTP上传和下载
# FTP操作 import ftplib host = '192.168.20.191' username = 'ftpuser' password = 'ftp123' file = '1.txt ...
- 如何在循环中使用await?
我正在尝试创建一个异步控制台应用程序,对集合进行一些操作.我有一个版本使用并行for循环,使用异步/等待.我预计异步/等待版本的工作类似于并行版本,但它同步执行.是什么原因呢? class Progr ...
- sorted 返回字典的所有键
- yield与递归的组合运用
- Beyond Compare 4过期
试用期到期操作:找到beyond Compare 4文件夹下面的BCUnrar.dll,将其删掉或者重命名,再重新打开接着使用!