Tower Help & Support

Working with Topic Branches

Topic branches are where your actual development work happens. These short-lived branches allow you to work on specific features, bug fixes, or experiments while keeping your base branches stable and clean. Managing topic branches effectively is essential for maintaining a productive development workflow and ensuring that your changes integrate smoothly with the rest of your project.

Starting a Topic Branch

Tower's Custom Git Workflows make starting new topic branches straightforward and consistent. When you need to begin work on a new feature or fix, you can use Tower's workflow system to create properly configured branches with minimal effort.

Using the Workflows Button

To start a new topic branch, click the Workflows button in Tower's interface. This opens a menu showing the available topic branch types you've configured, such as features, bug fixes, or hotfixes. Select the appropriate option for your work, and Tower will create the branch with the correct naming prefix and starting point.

For example, if you select "Start Feature," Tower might create a branch named feature/new-user-authentication starting from your configured development base branch. This ensures consistency across your team and eliminates guesswork about where new work should begin.

Branch Naming and Configuration

When you start a topic branch through Tower's workflow system, the branch automatically receives the appropriate prefix based on its type. Feature branches might use feature/, bug fixes could use bugfix/, and critical fixes might use hotfix/ as their prefix.

Tower also ensures that the new branch starts from the correct base branch according to your workflow configuration. Features typically start from your development branch, while hotfixes might start from your production branch, ensuring that each type of work begins from the appropriate foundation.

Updating a Topic Branch

As development progresses, your topic branch may need updates from its parent base branch. This is particularly important for long-running features or when critical changes are merged into the base branch while you're working.

Recognizing When Updates Are Needed

Tower provides visual indicators when your topic branch is behind its parent base branch. You'll see notifications or banners in the interface that alert you to available updates. These indicators help you stay aware of changes that might affect your work or cause conflicts when you're ready to integrate your changes back into the base branch.

The Update Process

When you need to update your topic branch, Tower makes the process simple and safe. You can initiate the update directly from the interface, and Tower will warn you about potential merge conflicts before proceeding.

The update process typically involves merging the latest changes from the parent base branch into your topic branch. This brings your work up to date with the latest developments while preserving your feature work. Tower handles the technical aspects automatically, but you maintain control over when the updates occur.

Managing Conflicts During Updates

Sometimes updating your topic branch will result in merge conflicts, especially if both your branch and the base branch have modified the same files. Tower provides comprehensive tools for resolving these conflicts efficiently.

When conflicts occur, Tower presents a clear interface showing the conflicting changes. You can review each conflict, understand what changes came from the base branch versus your feature work, and choose the appropriate resolution. This ensures that your updated topic branch incorporates both the latest base changes and preserves your development progress.

Finishing a Topic Branch

Once your work is complete and ready for integration, Tower's workflow system provides a streamlined process for finishing topic branches and integrating them back into your base branches.

Using the Finish Action

To finish a topic branch, you can click the Workflows button and select the appropriate finish option, or right-click on the branch and use the context menu. Tower will apply the merge strategy you've configured for that type of topic branch, whether that's creating a merge commit, squashing commits, or rebasing.

The finish action handles all the technical details of integration, including switching to the appropriate base branch, performing the merge, and cleaning up the topic branch if configured to do so.

Automatic Integration

When you finish a topic branch, Tower automatically integrates your changes into the configured target base branch using your predefined merge strategy. This ensures consistency across your team and reduces the chance of integration errors.

If your workflow is configured with auto-updates enabled, finishing a topic branch may also trigger updates to child branches that depend on the base branch where your changes were integrated. This helps maintain synchronization across your entire branch hierarchy.

Post-Integration Cleanup

After successfully finishing a topic branch, Tower can automatically clean up the local branch if you've configured it to do so. This keeps your branch list manageable and focuses attention on active development work.

You can also configure whether to delete remote topic branches after they're finished, helping maintain a clean remote repository while preserving the integrated changes in your base branches.