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

相关推荐
CoderJia程序员甲12 小时前
GitHub 热榜项目 - 日榜(2026-01-24)
git·ai·开源·llm·github
莫问前路漫漫12 小时前
Electerm 连接远程服务器完整指南
运维·服务器·git
鸣弦artha13 小时前
TabBar标签页组件详解
linux·git·ubuntu
小林up16 小时前
Ubuntu访问不了Git解决办法
linux·git·ubuntu
月初,1 天前
Git 常用操作大全(超详细教程)一文教会你完全使用Git
大数据·git·elasticsearch
李少兄1 天前
Git 忽略文件机制:.gitignore 与 .git/info/exclude
java·git·elasticsearch
github.com/starRTC1 天前
Claude Code中英文系列教程17:将Claude Code集成在GitLab工作流里面
git·gitlab·github
CCC:CarCrazeCurator2 天前
git merge与rebase的区别及实操心得体会
git
草莓熊Lotso2 天前
Qt 控件美化与交互进阶:透明度、光标、字体与 QSS 实战
android·java·开发语言·c++·人工智能·git·qt
小明同学012 天前
[C++进阶]深入理解二叉搜索树
开发语言·c++·git·visualstudio