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

相关推荐
克拉拉KLARA13 小时前
vscode禁用在git提交中插入ai coauthor copilot
git·vscode·copilot
水无痕simon14 小时前
05 Git 基础 – 查看提交历史
git
谢斯15 小时前
【GIT】子模块初始化与排错记录
git
遇见火星15 小时前
离线服务器时间同步NTP服务器配置
服务器·git·github
Soari15 小时前
Claude Code每日更新速览(v2.1.120-2026/04/27)-彻底摆脱 Git Bash,CI 级代码审查工具上线
git·ci/cd·bash·cluade code·ai for coding
芝士就是力量啊 ೄ೨15 小时前
如何配置Rust、Git,并从Github上拉下一个项目
git·rust·github
篮子里的玫瑰16 小时前
Git管理工具深度解析:从原理到企业级落地的全链路讲解
git·vscode
@PHARAOH1 天前
WHAT - git worktree 概念
前端·git
qinqinzhang1 天前
代码管理仓库(Git Submodules + Worktree)
git
lilili也1 天前
Git、VScode、GitLab
git·vscode·gitlab