git 使用场景 --amend 提交

场景:--amend 提交

bash 复制代码
1. make changes to a repo and git add 

2. git commit --amend                         amend提交通常会修正并更新commit message,或者增加新的修改
3. update the existing commit message 
4. git push --force origin main               必须force push才可以,一个commit被maend之后,git认为修正之后的commit与远程仓库的commit发生了偏离,git push会直接失败
   git push -f

Further Reading :****Git常用命令汇总

相关推荐
Python私教1 小时前
Git 撤销与回退避坑指南:reset / revert / restore 到底用哪个(2026 实战)
git
流浪0011 小时前
Linux篇(九):一文搞懂 Git:版本控制的原理与实操指南
git
Ws_3 小时前
Git + Gerrit 第九课:cherry-pick 挑选提交
git
之歆4 小时前
Day04_Git完全指南:从入门到精通的版本控制精通
git
码出财富4 小时前
InsForge 后端分支管理实战指南
git
2601_961194025 小时前
2026六级词汇PDF下载|大学英语六级单词表+音频PDF
windows·git·eclipse·pdf·github
幽冥三王爷7 小时前
Git 操作常见问题与处理办法
git
独挽离人8 小时前
git标准推送流程
git
无人生还别怕9 小时前
搭建gitlab服务并接入openldap认证
git·gitlab·github·openldap·ldap·统一认证
努力努力再努力wz10 小时前
【Qt入门系列】一文掌握 Qt 常用显示类控件:QLCDNumber、QProgressBar 与 QCalendarWidget
c语言·开发语言·数据结构·数据库·c++·git·qt