Is it safe to remove features?

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?

1 answer

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.

Excellent explanation - thanks.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

649 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you