Discover how to decline a Bitbucket pull request. We've provided detailed guidance for each approach through a series of clear steps. Check them all now!
delete a Bitbucket Pull Request (Step-by-step instructions)" />
Furkan Bicak April 13, 2023A pull request is a feature in Bitbucket that allows developers to propose changes to a codebase. However, sometimes a pull request may no longer be needed or may have been submitted in error. In such cases, you may want to delete the pull request.
We have listed three ways to delete a Bitbucket pull request and explain each method's authorization levels and requirements:
Let's find out which method works best for you.
The first and easiest way to delete a pull request in Bitbucket is to use the web interface. Here are the steps involved:
1. Log in to Bitbucket and navigate to the repository that contains the pull request you want to delete.
2. Click on the "Pull Requests" tab to see a list of all the open pull requests for the repository.
3. Find the pull request you want to delete and click on it to open it.
4. Once the pull request is open, you should see a button on the top right-hand side that says "Decline." Click on this button.
5. A confirmation window will appear, asking you to confirm that you want to decline the pull request. Click on "Decline pull request" to confirm.
6. The pull request will be deleted. You won't see it in your list of pull requests anymore.
It is necessary for you to have at least "write" access to the repository to use this method. This means that you must be a member of a group or have been given explicit permission to modify the repository by the repository owner or an administrator.
The Bitbucket API allows developers to interact with Bitbucket programmatically. This method can be useful if you need to automate the process of deleting pull requests. Here are the steps involved:
Replace with the access token you generated in step 2, with the name of your Bitbucket workspace, with the slug of the repository where the pull request is located, and with the ID of the pull request you want to delete. You can find the ID of the pull request in the URL of the pull request page.
To use this method, you must have a personal access token that has the "Pull Requests: Write" permission.
The third method to delete a pull request in Bitbucket is by using Git. Here are the steps involved:
To use this method, you must have “write” access to the repository and the ability to push changes to the remote repository. This means that you must be a member of a group or have been given explicit permission to modify the repository by the repository owner or an administrator.
Explore our Bitbucket pipelines and PR management apps for Slack