Change a Commit Message that Hasn't Been Pushed Yet

If you make a mistake in a commit message but HAVEN'T pushed it yet, you can change that commit message with --amend:

git commit --amend -m "New message"

This won't change any of the files in your commit - but will rewrite the commit with the new message.

Add More Files and Changes to a Commit Before Pushing

To add more files to the most recent commit, we can add them to the staging area with:

git add -A

and then rewrite the most recent commit to include them with:

git commit --amend -m "My new message"

Caution: only do this BEFORE you've pushed the commits - otherwise you will be re-writing history for people who may have already pulled down the old commits.

最新文章

  1. 看《css知多少》的一些总结
  2. 网友分享 调用dll的语音朗读 不能变速,不好
  3. Mvc模板页
  4. Atom + activate-power-mode震屏插件Windows7下安装
  5. ajax的参数
  6. random and password 在Linux下生成crypt加密密码的方法,shell 生成指定范围随机数与随机字符串
  7. ASP.NET Web - 服务器控件
  8. 超全超详细的HTTP状态码大全(推荐抓包工具HTTP Analyzer V6.5.3)
  9. 求第i个小的元素 时间复杂度O(n)
  10. HDU 4951 Multiplication table 阅读题
  11. 笔记整理——linux程序设计
  12. 团队作业8——Beta 阶段冲刺4th day
  13. Java并发编程:深入剖析ThreadLocal(转)
  14. 解决删除镜像时image is referenced in multiple repositories
  15. MFC开发中添加自定义消息和消息响应函数
  16. Python入门:数据结构的4种基本类型
  17. 剑指offer编程题Java实现——面试题7用两个栈实现队列
  18. vmstat和iostat命令进行Linux性能监控
  19. mybatis xml和dao扫描写法
  20. Java:IDEA设置虚拟机运行时参数

热门文章

  1. OI之路
  2. es+logstash+kibana搭建
  3. Istio 1.4 更新了 | 感觉学不完
  4. Python 中拼音库 PyPinyin 的用法【华为云技术分享】
  5. 示例:WPF中自定义MessageService应用DialogHost、Snackbar、NotifyIcon显示各种场景提示消息
  6. wangeditor视频
  7. elementUI一次请求上传多个文件
  8. Android-----解析xml文件的三种方式
  9. 08-Vuex
  10. prometheus学习系列十: Prometheus AlertManager配置文件说明