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的更多相关文章

  1. 通过git rebase修改commit message

    今天发现一个项目的git commit message中的单词拼错了,需要修改一下.但这样简单的修改,需要通过git rebase才能完成. 首先要git rebase到需要修改message的那个c ...

  2. 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 ...

  3. idea Please specify commit message

    在idea中使用github来进行版本控制的时候, 当点击提交的时候遇到了这个问题 错误: Please specify commit message 解决方法: 在commit message中填写 ...

  4. [译]How to Write a Git Commit Message

    原文: http://chris.beams.io/posts/git-commit/ 介绍:为什么好的commit message很重要 你浏览项目commit message的时候或多或少会有些困 ...

  5. git push后修改错误的commit message

    Easiest solution (but please read this whole answer before doing this): git rebase -i <hash-of-co ...

  6. Commit message 和 Change log 编写指南

    来源:http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html Git 每次提交代码,都要写 Commit messa ...

  7. 如何写好git commit message

    1.触发事件 我有这样一个版本库,里面包含两个学习用的练习项目:BookStore(以下简称BS)和PictureFriend(以下简称PF) 我在更改PF以后,未进行提交,同时又到BS中优化了一下文 ...

  8. Git 提交的正确姿势:Commit message 编写指南

    http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html Git 每次提交代码,都要写 Commit message( ...

  9. git第四节----git commit message

    @git  commit message 什么是git commit message :git commit -m '每次提交时编辑的内容' git commit message的好处:      1 ...

随机推荐

  1. Who is YaoGe.(搞笑篇)

      耀哥是google的大牛.主持google各种牛逼分布式系统的设计,比方Mapreduce之类的,关于大神的传说,如同春哥一样多,当然,有些传说仅仅有程序猿能明确! 耀哥当初面试Google时.被 ...

  2. LPC-Link-II Rev C JTAG

  3. Revit API创建墙的保温层修改墙厚度

    start [Transaction(TransactionMode.Manual)] [Regeneration(RegenerationOption.Manual)]  / ;         ; ...

  4. Revit API遍历系统族布置喷头

    系统族可以通过内参遍历,遍历出来是个FamilySymbol喷头属于系统族,但不能通过NewDuct();类似这样的方法布置.必须使用 NewFamilyInstance() );           ...

  5. 十步轻松搞定IIS+PHP环境搭建

    突然心血来潮想着自己一直使用Apache+php的模式,想要了解一下IIS+php的模式.说起来也算是九曲十八弯吧! 第一部分:以ISAPI.dll 扩展的形式 结果按照资料上面说的我就是找不到一个i ...

  6. Linux声卡驱动框图

    1.声卡驱动注册完成后的框图 2.open & hw_params 完.

  7. C#编程(二十四)----------修饰符

    修饰符 修饰符即应用于类型或成员的关键字.修饰符可以指定方法的可见性,如public或private,还可以指定一项的本质,如刚发的vritual或abstract. 可见性的修饰符 修饰符 应用于 ...

  8. python测试开发django-32.admin后台多对多关系ManyToManyField

    前言 一本书可以有多个作者,一个作者也可以写多本书,这种关系就是本篇要说的多对多关系. 这种场景在django里面数据库设计时候,需要用到ManyToManyField方法 多对多表设计 auther ...

  9. linux dig命令 转

    dig 命令主要用来从 DNS 域名服务器查询主机地址信息. 查询单个域名的 DNS 信息 dig 命令最典型的用法就是查询单个主机的信息. $ dig baidu.com dig 命令默认的输出信息 ...

  10. POP缩放动画

    POP缩放动画 效果 源码 https://github.com/YouXianMing/Animations // // SpringScaleViewController.m // Animati ...