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

相关推荐
阿崽meitoufa1 小时前
hermes-agent安装到本地 Git方法
git·hermes·hermes-agent
云攀登者-望正茂4 小时前
特性分支合并develop引发的污染问题
git
就叫年华吧丶6 小时前
Git Bash、CMD 与 PowerShell 的区别详解
linux·git·命令行·powershell·cmd·gitbash
白玉cfc7 小时前
Git提交规范
git·github
电化学仪器白超19 小时前
小乌龟Git全程图形化操作指南:嵌入式本地版本管理与Gitee私有云备份实战
git·python·单片机·嵌入式硬件·物联网·gitee·自动化
K3v1 天前
【git】删除本地以及远端已经合并到master的分支
大数据·git·elasticsearch
云攀登者-望正茂1 天前
将 develop 分支拉取到特性分支时解决合并污染问题
git
金銀銅鐵1 天前
[git] 如何找到已经“丢失”的 commit?
git·后端
尘世壹俗人1 天前
linux编译安装git
linux·运维·git
打不了嗝 ᥬ᭄2 天前
Git 原理与使用
git·gitee