0

I have Branch A and Branch B.
I merged Branch B into Branch A.

Branch B remains open in my branch list. Is it safe to delete?

Will it not revert any of my branch changes?

Using BitBucket.

Aleksandar Zoric
  • 1,343
  • 3
  • 18
  • 45

1 Answers1

1

Yes , you can delete the branch after merge

git branch -d fancy_branch_name

When you merge a branch to another branch a new commit hash was created. It includes the current branch (in your case that is branch A) and the changes coming from another branch (branch B)

So whatever changes you have merged in branch A that comes from branch B are preserved in git hash tree

Everything in git was maintained through hashes.

Deleting a branch just deletes the reference to the hash, which the brach name was pointing to.

For example :

Branch B currently maybe pointing to some hash

BrnachB --> 2f4sgsgta45s

Deleting the branch will just delete the reference to the hash, actual hash will be still present in the whole git tree structure

Keyur Barapatre
  • 237
  • 2
  • 11