[Git] Change the commit message of my last commit
Did you make a typo in your last commit message? No problem, we can use the git --amend command to change it very easily. Note: This only holds if you did not yet push your changes to the remote repository
git commit --amend
It open the REPL let you to modify the last commit message.
We shouldn't change the commit message from the remote repo, it break other prople commit logs
--amend can be used in another case, which you forgot to save one file, but you already did one commit, in this case, you might want to add this file into previous commit as well instead of creating a new commit.
all you need to do is:
// save the file
git add .
// do the commit with amend
git commit -amend
// in the popup REPL,you can modify the previous commit message or just keep it and continue
[Git] Change the commit message of my last commit的更多相关文章
- 通过git rebase修改commit message
今天发现一个项目的git commit message中的单词拼错了,需要修改一下.但这样简单的修改,需要通过git rebase才能完成. 首先要git rebase到需要修改message的那个c ...
- Git remote: ERROR: missing Change-Id in commit message
D:\code\项目仓库目录>git push origin HEAD:refs/for/dev/wangteng/XXXXX key_load_public: invalid format E ...
- idea Please specify commit message
在idea中使用github来进行版本控制的时候, 当点击提交的时候遇到了这个问题 错误: Please specify commit message 解决方法: 在commit message中填写 ...
- [译]How to Write a Git Commit Message
原文: http://chris.beams.io/posts/git-commit/ 介绍:为什么好的commit message很重要 你浏览项目commit message的时候或多或少会有些困 ...
- git push后修改错误的commit message
Easiest solution (but please read this whole answer before doing this): git rebase -i <hash-of-co ...
- Commit message 和 Change log 编写指南
来源:http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html Git 每次提交代码,都要写 Commit messa ...
- 如何写好git commit message
1.触发事件 我有这样一个版本库,里面包含两个学习用的练习项目:BookStore(以下简称BS)和PictureFriend(以下简称PF) 我在更改PF以后,未进行提交,同时又到BS中优化了一下文 ...
- Git 提交的正确姿势:Commit message 编写指南
http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html Git 每次提交代码,都要写 Commit message( ...
- git第四节----git commit message
@git commit message 什么是git commit message :git commit -m '每次提交时编辑的内容' git commit message的好处: 1 ...
随机推荐
- HDU 3979 Monster (贪心排序)
Monster Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- HDU 4498 Function Curve (自适应simpson)
Function Curve Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)To ...
- 使用Java进行串口SerialPort通讯
1.准备工作 在进行串口连接通讯前,必须保证你当前操作电脑上有可用且闲置的串口.因为一般的电脑上只有一个或者两个串口,如COM1或COM2,但大多数情况下,这些串口可能会被其他的程序或者 ...
- 对 Git 分支 master 和 origin/master 的一些认识
首先要明确一点,对 Git 的操作是围绕 3 个大的步骤来展开的(其实几乎所有的 SCM 都是这样) 从 git 取数据(git clone) 改动代码 将改动传回 git(git push) 这 3 ...
- JavaScript进阶系列03,通过硬编码、工厂模式、构造函数创建JavaScript对象
本篇体验通过硬编码.工厂模式.构造函数来创建JavaScript对象. □ 通过硬编码创建JavaScript对象 当需要创建一个JavaScript对象时,我们可能这样写: var person = ...
- Delphi中StrToDateTime函数TFormatSettings参数的使用
var FSetting : TFormatSettings; DateTime1: tDateTime; begin FSetting := TFormatSettings.Cr ...
- 【Devops】【docker】【CI/CD】1.docker搭建Gitlab环境
CI/CD[持续化集成/持续化交付] docker搭建Gitlab环境 1.查询并拉取gitlab镜像 docker search gitlab docker pull gitlab/gitlab-c ...
- 在Android.mk文件中输出打印消息
http://www.xuebuyuan.com/1947880.html 在进行Android NDK的开发当中有时想看看Android.mk文件当中某个变量的值,可以再Android.mk文件当中 ...
- Git:常用命令(二)
查看提交历史 git log 撤消操作 任何时候,你都有可能需要撤消刚才所做的某些操作.接下来,我们会介绍一些基本的撤消操作相关的命令.请注意,有些操作并不总是可以撤消的,所以请务必谨慎小心,一旦失误 ...
- poj 3071 Football(概率dp)
id=3071">http://poj.org/problem? id=3071 大致题意:有2^n个足球队分成n组打比赛.给出一个矩阵a[][],a[i][j]表示i队赢得j队的概率 ...