Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

What are the difference between branch delete, close or archive

Wojtek Pilwinski February 16, 2022

Hello,

I am quite new in git and I would like to ask for help in understanding the differences between deleting branch, closing it or moving to archive?

When I creating new pull request in Bitbucket cloud there is option to check "Delete My-Branch-Name after the pull request is merge".

But when I merging the same pull request in Bitbucket cloud then I have option to check "Close source branch".

Are those two options combine with each other, can I have here any conflicts here?

For example what will happen if I choose "Close source branch" when merging, but before (when I was creating pull request) I checked "Delete My-Branch-Name after the pull request is merge".

I am not even sure if those two actions are only Bitbucket's or at all Git's features?

 

But I've also heard about archiving branches on Git. And it seems to be for me the best option while I mainly want to archive branches instead deleting them. I would like to delete branch only manually. But not sure how to achieve that?

Or maybe "Close source branch" (when merging) is the same as archiving it? Or is it something else? 

 

For any help in understanding those issues great thanks in advance.

Best Regards

 

1 answer

0 votes
MutatedStrings February 17, 2022

The close and delete options should do the same thing. Once the pull request is merged into the destination branch it should delete(close) the source branch if any of the options are selected. 

 

Also if we do not choose to close/delete a branch then we can leave this option unchecked and bitbucket will not delete the branch once your pull request is merged. This means the branch would still be available in the repository and you can delete it manually when needed.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events