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常用命令汇总

相关推荐
不老刘5 分钟前
Git Cherry-Pick:微前端架构下的“精准医疗”与最佳实践
前端·git
爬楼的猪1 小时前
Git Folder Dashboard
git
Uncertainty!!1 小时前
claude code中添加skills自动生成git commit信息
git·git commit·claude code
FserSuN3 小时前
Git Worktree 使用学习
git·学习
Z文的博客3 小时前
嵌入式LINUX QT 开发 .gitignore 文件编写指南
linux·git·qt·elasticsearch·嵌入式
前端双越老师3 小时前
3 个命令 7 个步骤,学会 git worktree 并行开发
git·ai编程·全栈
小黑要努力18 小时前
智能音箱遇到的问题(一)
linux·运维·git
RePeaT18 小时前
【git】指令场景实战:单分支与多分支协作流程
git
前端Hardy19 小时前
杀疯了!Git 2.54 正式发布,3个封神新特性,效率直接翻倍!
git
Eloudy21 小时前
迁移带有 git lfs 功能的 github 仓库
git·github