My project has many feature branches that are either merged back to main, or stale and no longer used. The sidebar in SourceTree is getting crowded, and I'd like to clean it up.
Is it safe to remove the features I no longer work on, without losing the code that was merged back?
Yes, it is completely safe to remove these branches.
Remember that a "branch" is just an alias to a particular commit, much like a label. The only difference is that a branch always points to the tip of a development line. This is a bit different from our intuitive understanding of what a branch is (where we may think of it as there series of commits that brought us to this tip). This distinction is important. This means that when you delete a branch, you are only deleting the named pointer. You are not deleting any commits or the parent-child relationship between them. They will still be a part of your repos history, they just won't have a special name any longer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.