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:Ā 

What happens to the Git branch when a pull request is declined?

Harrison McCullough
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!
October 16, 2020

What happens to the associated Git branch when a pull request is declined? I believe the documentation says that nothing happens to the underlying repository.

What happens if the branch is later deleted? Will the pull request still "hold on" to the code that was supposed to be merged? Or will Git eventually garbage collect them if no branches/tags reference the changed code?

In case it's helpful, I'm wondering what will happen if these steps happen:

  1. Branch is created
  2. Commits are added to the branch
  3. Pull request is created based on the branch
  4. Pull request is declined
  5. The branch is deleted on the server

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Mikael Sandberg
Community Champion
October 16, 2020

If you delete a branch that have not been merged, as in the scenario of a pull request being declined, your commits would also be lost. So the only thing the pull request would hold on to would be the commits, but since those have been deleted you would not be able to reopen or view the code changes. This is why Bitbucket gives you a warning when deleting a branch with commits that you will lose those changes too.

Harrison McCullough
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!
October 16, 2020

That's what I assumed. Thank you for confirming!

Like • Mikael Sandberg likes this
TAGS
AUG Leaders

Atlassian Community Events