> For the complete documentation index, see [llms.txt](https://wikinote.gitbook.io/git-learning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wikinote.gitbook.io/git-learning/git-gao-ji-ming-ling/chang-yong-chang-jing-shi-zhan/git-force-update-remote-commit.md).

# 修改远程仓库提交

> 如果你已经把本地提交commit已经push到远程分支。但是如果发现本地分支的代码出现错误，需要重写commit历史，例如使用了git commit --amend，一般情况下，远程分支是会拒绝本次提交，这样只能够通过强制更新远程分支（洗版）来进行更新。

## 强制提交远程分支

```
git push -f
```

## 注意事项

此操作非常危险，如果远程分支已经被其他人fetch到本地分支，就严格禁止再更改原有的commit历史！
