git修改已提交的commit

This commit is contained in:
yewuya 2021-02-19 18:00:15 +08:00
parent 610cfa3c90
commit 13032e104a

View File

@ -0,0 +1,13 @@
# git 修改已提交的commit
```sh
git rebase -i HEAD~1 #修改commit HEAD~1为commit的数量
#在打开的文件中将需要修改的commit前的pick改为edit,并保存关闭文件
git commit --amend #修改commit内容
git rebase --continue #完成内容修改
git push --force origin #强制提交
```