Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to reuse a deleted branch's name?

Tags:

branch

svn

For example:

  1. I create a branch named refactor.
  2. I reintegrate the branch to the trunk.
  3. I delete the branch.

Is it safe to repeat the process with another branch named refactor?

like image 661
Fredrick Avatar asked Dec 19 '12 16:12

Fredrick


People also ask

Can you reuse a branch name in git?

You can always reuse that branch if you'd like or remove it.

What happens when you delete git branch?

What Happens If I Delete a Git Branch? When you delete a branch in Git, you don't delete the commits themselves. That's right: The commits are still there, and you might be able to recover them.

Is it safe to delete merged branches?

So you should feel perfectly safe deleting the branch after the merge. One more thing you could do though, is once the hotfix is merged, create a tag on the master branch identifying that point as the hotfix release.


2 Answers

With SVN the only problem you might run into is that when merging the mergeinfo property of the merge point (folder or file depending on the level where the merge was made) will contain the branch name and revision numbers of previous merges. I don't think that SVN actually uses this information when merging, but it becomes confusing sometimes as a user.

If you don't care about this then it should work fine ... but I know in previous projects we used mergeinfo as an indication of what branches we had merged back into trunk, so re-using a branch name would be dangerous.

like image 53
cottonke Avatar answered Sep 21 '22 13:09

cottonke


Yes, you can do this, as long as you're not confused about which refactor is which when you look at the Subversion log history.

Assuming you have some sort of trouble ticket system, it would be better to tie particular revisions to the trouble ticket that caused the revision to be made, either by number or code.

like image 29
Gilbert Le Blanc Avatar answered Sep 20 '22 13:09

Gilbert Le Blanc