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. SQLSERVER误删Windows登录用户验证方式使用Windows身份验证的解决方法

    今天看到这篇文章:没有了SA密码,无法Windows集成身份登录,DBA怎么办? 想起来之前着急哥问我的一个问题,一个DBA删除了Windows登录用户,而且SQLSERVER服务器的验证方式是Win ...

  2. 【Oracle】-【LRU和DBWR】-LRU算法与DBWR中的应用

    Oracle体系结构中经常看到LRU算法,Least Recently Used,也有叫“最近最少使用页面置换算法”,简单讲,Oracle会将内存中最近不用的数据库移出内存以腾出空间来加载另外的数据. ...

  3. Windows Phone本地数据库(SQLCE):5、[Association]attribute(翻译)(转)

    这是“windows phone mango本地数据库(sqlce)”系列短片文章的第五篇. 为了让你开始在Windows Phone Mango中使用数据库,这一系列短片文章将覆盖所有你需要知道的知 ...

  4. C#编程(三十三)----------Array类

    Array类 创建数组 Array intArray1 = Array.CreateInstance(typeof(int), 5); for (int i = 0; i < 5; i++) { ...

  5. SharePoint 如何导出部署的场解决方案

    前言 当我们在做服务器场迁移或者备份的时候,经常需要场中部署的解决方案包,然而,很多时候,我们无法找到这些解决方案包.很多解决方案在部署的时候,可能就已经删掉了,很多解决方案由于时间久远,我们不知道哪 ...

  6. 混乱之子第七季/全集Sons of Anarchy迅雷下载

    英文译名 Sons of Anarchy (第7季) (2014-秋季档回归)FX. 本季看点:<混乱之子>(Sons of Anarchy)最终季的客串演员还在不断增多.曾在1996年因 ...

  7. 彻底理解Java的feature模式

    先上一个场景:假如你突然想做饭,但是没有厨具,也没有食材.网上购买厨具比较方便,食材去超市买更放心. 实现分析:在快递员送厨具的期间,我们肯定不会闲着,可以去超市买食材.所以,在主线程里面另起一个子线 ...

  8. Java 条件编译

    在C/C++中,使用#ifdef…#endif的代码,如果不满足条件,编译器是不会对这部分代码进行编译的.Java中并没有这种“条件编译”特性.这种特性在C语言里是用来解决代码的跨平台问题的,可以通过 ...

  9. .condarc(conda 配置文件)、换国内源

    原文地址 https://blog.csdn.net/lanchunhui/article/details/71379555 Configuration — Conda documentation . ...

  10. django的权限认证:登录和退出。auth模块和@login_required装饰器

    在settings.py中配置LOGIN_URL参数: # 用户访问带有(@login_required)标签的页面(view)时,如果没有登录,就会跳转到LOGIN_URL(即登陆url). LOG ...