Delete Pull Requests from Azure DevOps

M Usman Siddiqui 0 Reputation points
2025-02-25T04:05:05.1+00:00

We accidently pushed some data into a branch in Azure Repo and created 3 PRs(2 merged and 1 Abandoned). We want to delete the records of the PRs. We can not find any way to do it.

Appreciate if anyone could help in this regard?

Azure DevOps
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Martin Brandl 545 Reputation points MVP
    2025-02-25T06:52:59.8133333+00:00

    Azure DevOps retains PRs for traceability. If complete removal is mandatory, repository recreation is the only full-proof method:

    1. Clone the repository locally.
    2. Remove the .git folder to clear history.
    3. Reinitialize (git init) and push it to a new Azure Repo.

    You would ofc loose all PRs this way...

    The other method would be, to use the Azure DevOps AI to update the PR details to minimize their visibility (rename, remove descriptions):


  2. Suresh Chikkam 2,135 Reputation points Microsoft External Staff Moderator
    2025-03-06T03:28:29.02+00:00

    Thanks @Martin Brandl for the insightful response! Just to add on for the community’s benefit:

    Yes @M Usman Siddiqui , removing/deleting the .git folder clears the commit history and all associated metadata, including pull requests. However, this will also result in the loss of your entire commit history, so it’s important to consider the trade-off.

    As for the retention of pull requests in Azure DevOps, there is no hard limit on the number of PRs that can be stored. However, as Martin mentioned, performance considerations come into play. With very large numbers of PRs, you might encounter slower UI responsiveness or pagination issues, but Azure DevOps doesn’t impose a strict limit on how many PRs can be retained.

    Hope it helps!


    Please do not forget to click "Accept the answer” and Yes wherever the information provided helps you, this can be beneficial to other community members.

    User's image

    If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.