The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can you delete a branch with uncommitted pull requests?

Jean Hilaire
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 1, 2023

i have some old branches in my team's repository that i'm finally cleaning up, however, some of these branches and commits that haven't been merged into the master branch yet.  these are so old that i just want to delete them with no merge.  is this possible?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2023

Hello @Jean Hilaire ,

Welcome to Atlassian Community!

You can definitely delete branches in the UI by accessing the Branches option in the left panel, clicking on the three-dot icon (Action column) in the line of the branch you want to delete, and selecting Delete.

However, if the branch to be deleted is the source or destination branch of an Open pull request, the Delete option will be greyed-out and you will not be able to delete it while the Pull Request is still in the Open state.

The workaround in this case, as you don't want to merge those old Pull requests anymore, is to access the Pull Request page and filter for any PRs where the branch you want to delete is either the source or destination branch. Then you can open each of the PRs, click on the three-dot icon and select Decline. This will close the Pull request with the state Declined. Once all the open PRs of a given branch are declined, you should be able to delete that branch in the UI as usual.

Hope that helps! Let me know in case you have any questions.

Thank you, @Jean Hilaire 

Patrik S

Jean Hilaire
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 6, 2023

Thank you!  The workaround has worked in some way.  We've had to create a new branch, committing the code and pushing this out to the new branch and then ultimately delete the old branch. 

TAGS
AUG Leaders

Atlassian Community Events