Automatic Branch Management
As your repository grows and your team completes more work, the number of branches in your sidebar can quickly become overwhelming. Old feature branches that were merged months ago, experimental branches you forgot about, and outdated work-in-progress branches all clutter your sidebar, making it harder to find the branches you actually need. Tower's automatic branch management helps you maintain a clean, organized repository by identifying branches that are no longer actively needed and providing simple tools to archive them.
Why Automatic Branch Management Matters
A cluttered sidebar isn't just an aesthetic problem—it impacts your productivity and team collaboration. When dozens of obsolete branches fill your sidebar, it becomes difficult to:
- Find the active branches you need to work with
- Understand which branches represent current work
- Identify potential conflicts or problems with active development
- Maintain a clear overview of your project's structure
Automatic branch management solves these problems by intelligently detecting branches that are candidates for archiving, marking them clearly in your sidebar, and providing streamlined workflows to organize them. This keeps your working environment focused on what matters while preserving the branches in case you need them later.
How Tower Detects Archivable Branches
Tower automatically analyzes your branches to identify two specific categories that typically signal a branch is no longer actively needed:
Stale branches haven't received any commits for an extended period. These are branches where development has stopped, often because the work was abandoned, put on hold indefinitely, or simply forgotten. While a stale branch isn't necessarily ready to be archived—you might plan to return to it—it's a strong signal that the branch may no longer be relevant to your current work.
Fully merged branches contain commits that have all been integrated into another branch in your repository. When a branch is fully merged, keeping it active in your sidebar serves little purpose since all its changes already exist elsewhere. These branches are prime candidates for archiving to reduce clutter.
Tower continuously monitors your branches for these conditions, updating their status as your repository evolves. This means you always have current information about which branches might be ready for archiving.
Sidebar Badges for Stale and Merged Branches
When Tower detects that a branch is stale or fully merged, it displays a special badge at the end of the sidebar item row. These visual indicators make it immediately clear which branches are candidates for archiving without requiring any additional clicks or navigation.
The badges appear automatically based on Tower's analysis, giving you at-a-glance visibility into branch status. You can configure these badges through the Sidebar View Settings, which gives you individual control over displaying stale branch badges and fully merged branch badges. By default, both badge types are enabled to help you maintain a clean repository.
Configurable Badge Display In Sidebar View Settings, you can independently enable or disable badges for stale branches and fully merged branches, allowing you to see only the information most relevant to your workflow.
Archiving Branches to Clean Up Your Sidebar
When you identify branches that you want to remove from your main sidebar view but aren't ready to delete permanently, archiving provides the perfect solution. Archiving a branch moves it into a special Archived Branches section, which you can keep collapsed to maintain a clean sidebar while preserving the branch for future reference.
To manually archive a branch, right-click it in the sidebar and select from the context menu. The branch immediately moves to the Archived Branches section, decluttering your sidebar without deleting anything. If you need to access an archived branch later, simply expand the Archived Branches section—all the branches remain fully functional and can be checked out, merged, or otherwise worked with just like any other branch.
This approach gives you the best of both worlds: a clean, focused sidebar for your daily work, and complete access to historical branches whenever you need them.
The Archive Branches Dialog
When Tower detects that you have archivable branches (stale or fully merged), a button appears in the sidebar's bottom bar, making it easy to review and archive multiple branches at once. Clicking this button opens the Archive Branches dialog, which presents all candidate branches in an organized list.
In this dialog, you can quickly scan through the suggested branches, select the ones you want to archive, and process them all with a single action. This bulk operation is far more efficient than archiving branches one by one, especially when you're doing periodic maintenance on a repository with many completed feature branches.
The dialog provides context about why each branch is suggested for archiving—whether it's stale, fully merged, or both—helping you make informed decisions about which branches to archive. You can select all branches, pick specific ones, or skip any that you want to keep active in your main sidebar.
Making Archiving Decisions If you're unsure about archiving a branch, remember that archiving is reversible. Archived branches remain in your repository and can be easily accessed through the Archived Branches section if you need them later.
Automatic Archiving for Hands-Free Maintenance
For teams and individuals who prefer a more automated approach, Tower offers an option to automatically archive stale and fully merged branches without manual intervention. When you enable automatic archiving in the Sidebar View Settings, Tower handles branch archiving in the background, continuously keeping your sidebar organized.
This setting is also accessible directly from the Archive Branches dialog, making it easy to enable when you first start using the feature. Once activated, Tower applies the same detection criteria but automatically moves matching branches to the Archived Branches section as they meet the conditions.
Automatic archiving is particularly valuable for:
- Large repositories with frequent branch creation
- Teams where many developers create feature branches
- Projects with long development cycles where branches naturally become stale
- Anyone who prefers a hands-off approach to repository maintenance
Even with automatic archiving enabled, you maintain full control through the ability to flag specific branches to skip auto-archiving, ensuring important branches are never automatically archived.
Workflow Integration and Protected Branches
If you're using Tower's Custom Git Workflows feature, you'll appreciate that automatic branch management integrates intelligently with your workflow configuration. Base branches that you've configured through Tower Workflows are automatically protected from archiving—they will never be flagged as archivable or automatically archived, even if they technically meet the criteria.
This protection makes sense because workflow base branches like main, develop, staging, or custom long-lived branches represent foundational elements of your development process. They should remain visible and accessible in your sidebar at all times, regardless of when they last received commits or their merge status.
Tower recognizes these branches based on your workflow configuration and excludes them from all automatic branch management operations. You can work confidently knowing that your carefully configured workflow structure won't be disrupted by branch archiving.
Flagging Branches to Skip Auto-Archiving
Sometimes you have branches that meet the technical criteria for archiving—they're stale or fully merged—but you want to keep them visible in your main sidebar. Perhaps it's a branch you reference frequently, a template you use for new work, or simply a branch you prefer to keep easily accessible for personal workflow reasons.
For these situations, you can explicitly flag any branch to skip auto-archiving. Right-click the branch in your sidebar and enable from the context menu. Once flagged, Tower will never automatically archive this branch, even with automatic archiving enabled, and won't display archive suggestion badges for it.
This per-branch control gives you precise authority over which branches are managed automatically and which remain untouched. You can flag and unflag branches at any time as your needs change, providing flexibility while still benefiting from automatic management for the majority of your branches.
Use Cases for Skip Auto-Archiving Common scenarios include reference branches, template branches you copy for new features, branches for documentation or examples, and any branch tied to a specific external process or requirement.
Getting Started with Automatic Branch Management
To begin using automatic branch management:
- Open Sidebar View Settings (available from the menu or the view settings button in the sidebar's bottom bar)
- Ensure that badges for stale and fully merged branches are enabled
- Review your sidebar for branches displaying archival badges
- Click the archive button in the sidebar bottom bar when it appears
- In the Archive Branches dialog, select branches to archive
- Optionally, enable automatic archiving for hands-free maintenance
Workflow Configuration Recommended Before enabling automatic archiving, we recommend setting up at least your base branches in a Workflow. This ensures they're never accidentally archived and are displayed with priority in your sidebar, maintaining clear visibility of your repository's foundational branches.
As you work with this feature, you'll develop a workflow that suits your needs—whether that's periodic manual archiving, fully automatic archiving, or a hybrid approach where you manually review suggestions while relying on automation for obvious cases.
By keeping your sidebar clean and organized, automatic branch management helps you focus on your current work while ensuring historical branches remain accessible when needed. It's branch hygiene made simple.