1

I have a pretty big project on Github with several other contributors, and we have reached the point where we have a list of braches that we no longer can "manage" (i mean that every time i do git branch the list way too long)

Most of those branches are now useless since they are something like "fix-xxx" so i would like to "close" them, so that i can still see them on the Network tab, but they will be something like archived

Are there something like this o i have to delete them?

Alberto Sinigaglia
  • 12,097
  • 2
  • 20
  • 48

2 Answers2

1

Considering there is no "lock/obsolete" attribute that would make those branches invisible, deleting them is the normal course of action.

If you have to keep a reference to them, I would create a separate repository where I would push those branch.
Then I would delete the same branches in the original repository.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • thank you, this is why big repos use `merge squash` and `rebase` instead of `merge`? i mean, with those 2 we have a sort of reference/backtracking, thing that we don't have when we delete a branch – Alberto Sinigaglia Sep 22 '20 at 12:18
  • @Berto99 in a squash merge (https://github.blog/2016-04-01-squash-your-commits/#:~:text=Commit%20squashing%20has%20the%20benefit,the%20individual%20commits%20from%20history) you still have to delete your feature branch. Rebase is more a way to update feature on top of master. – VonC Sep 22 '20 at 12:21
1

One possible option is to rename the branch to archive/branchName. Git remote will then update any associated entities (PRs, etc) and warn any users attempting to make a push to the former name.

SourceTree will display all branches with a similar prefix (archive/) in their own folder within the branch list. This way you end up with a folder dedicated to just the archived branches.

Bill Tarbell
  • 4,933
  • 2
  • 32
  • 52