knowledge_map/git 修改已提交的commit.md

14 lines
464 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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 #强制提交
```