> For the complete documentation index, see [llms.txt](https://70825.gitbook.io/git-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://70825.gitbook.io/git-tutorial/add-commit-push-deep/force-push.md).

# 강제 push 하기

강제 push는 만약 GitHub 기록을 덮어쓰기를 진행해야 할 때 사용하는 방법입니다.

사용하는 방법은 <mark style="color:red;">`git push -f`</mark> 입니다. 이것은 바로 다음에 배울 <mark style="color:red;">`git commit --amend`</mark>, <mark style="color:red;">`git reset --soft`</mark>, <mark style="color:red;">`git reset --hard`</mark> 와 같이 커밋 메시지를 수정하거나, 코드를 수정한 뒤 기록을 덮어쓸 때 사용합니다.

강제 push를 사용하는 방법의 경우에는 다시 기록을 복구하는 것이 힘들기 때문에 주의해서 사용하시길 바랍니다.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://70825.gitbook.io/git-tutorial/add-commit-push-deep/force-push.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
