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. J1850 Implement

    http://avrobdii.googlecode.com/svn/trunk/code/J1850.c /* Copyright (C) Trampas Stern name of author ...

  2. showplan_text查询计划查询 sql执行顺序 时间 IO

    http://www.cnblogs.com/happyday56/archive/2009/09/10/1564144.html   set showplan_text ongoselect exp ...

  3. GUN WINDOW 工具

    GNU utilities for Win32 CoreUtils for Windows 或者 完整的 package dd for windows Unix ports - WHICH, TEE ...

  4. Chilkat----开源站点之VS2010 CKMailMan一个很好的邮件发送开源开发包

    Chilkat 是一个很好的开源站点,有各种开源库. 开发语言主要有Classic ASP •C • C++ • C# • Delphi ActiveX • Delphi DLL • Visual F ...

  5. Occlusion Culling遮挡剔除理解设置和地形优化应用

    这里使用的是unity5.5版本 具体解释网上都有,就不多说了,这里主要说明怎么使用,以及参数设置和实际注意点 在大场景地形的优化上,但也不是随便烘焙就能降低帧率的,必须结合实际情况来考虑,当然还有透 ...

  6. Mac下启动AndroidStudio失败

    系统环境: OSX Yosemite 10.10.1 (14B25) JAVA版本:1.8.0_11 Android Studio 版本:1.0.1 问题:Android Studio was una ...

  7. solc 编译Solidity

    安装 sudo add-apt-repository ppa:ethereum/ethereum sudo apt-get update sudo apt-get install solc 编译 so ...

  8. [Web 前端] React高级教程(es6)——(2)对于Refs最新变动的理解

    cp : https://blog.csdn.net/liwusen/article/details/53384561 1.什么是ReactJS中的refs 在React中组件并不是真实的 DOM 节 ...

  9. Java反编译工具Jad详解

    做项目过程中需要反编译一个jar包,于是作了一些学习,记录下来. Jad(JAva Decompiler)是一个Java的反编译器,可以通过命令行把Java的class文件反编译成源代码. 如果你在使 ...

  10. Unexpected identifier in composer-common/lib/cardstore/businessnetworkcardstore.js:54

    c错误描述 Unexpected identifier in composer-common/lib/cardstore/businessnetworkcardstore.js:54 yo hyper ...