# Why do force-pushes cause problems for PullRequest?

## What force-pushes are

Forced pushes cause mutations of your git repository's history. These include:

```
git push --force
```

And:

```
git push --force-with-lease
```

Though the practice is generally discouraged, from time to time you may find yourself in a situation that requires it.

One of the negative side effects of force-pushing is that it will cause workflow issues with services such as PullRequest that interact with your version control provider (such as GitHub, GitLab, or Bitbucket).

### Issues resulting from force-pushes

* Version control providers have to apply special handling of these updates, so changes are not always propagated to PullRequest and other integrated services immediately.
* If PullRequest, or another member or your team, is actively reviewing a pull or merge request during a force-push, the code being reviewed will become outdated since it was aggregated based on the repository's git history (which has been mutated).
* Any important information regarding issues with the code applied as a comment may be lost and unrecoverable.

{% hint style="danger" %}
**Force-pushing may cause PullRequest completion time to be extended since in most cases reviewers will need to stop work and start over.**
{% endhint %}

### How to avoid these issues

We strongly encourage limiting force-pushes to branches which are not part of an open pull or merge request. We also recommend ensuring that no additional CI programs are processing builds at the time you force-push as it will also cause errors with those programs.

If a pull or merge request is open and a situation arises where a force-push is required, an alternative is to close your current pull or merge requests, force-push, then re-created them based on the new git history.


---

# Agent Instructions: 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://docs.pullrequest.com/force-push-pull-request-errors/master.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.
