Committing Changes to Stacked Branches
In the Graphite workflow, committing changes to stacked branches requires special consideration to maintain the proper relationships between branches in your stack. Tower provides several options for committing changes to stacked branches.
Regular Commits
You can create regular commits on a stacked branch just as you would on any other branch:
- Make your changes to files in your working copy
- Stage the changes you want to include in your commit
- Enter a commit message
- Click the button
When you create a regular commit on a stacked branch, the following actions will be performed:
- Add the commit to the current branch
- Maintain the branch's position in the stack
- Automatically restack child branches if possible
This is equivalent to using the gt modify --commit
command in the Graphite CLI.
Modifying Commits (Amending)

In Graphite terminology, "modifying" a commit means amending the last commit on a branch. This is particularly useful when you need to make small adjustments to your most recent changes:
- Make additional changes to files in your working copy
- Stage the changes you want to include
- Check the checkbox in the commit view, which will change the button to
- Click the button
When you click the Modify button, the following actions will be performed:
- Amend the last commit on the current branch
- Automatically restack child branches if possible
This is equivalent to using the gt modify
command in the Graphite CLI.
Quick Tip
Hold down the Option key to quickly switch to "Modify" mode without checking the checkbox. This temporarily changes the button to while the key is pressed.
Creating a New Stacked Branch with a Commit

If you want to create a new stacked branch and commit changes to it in one step:
- Make your changes to files in your working copy
- Stage the changes you want to include
- In the commit view, click the button
When you click the Create button, the following actions will be performed:
- Create a new stacked branch based on the current branch (the branch name will be auto-generated from your commit message)
- Commit all staged changes to this new branch
- Automatically set up the proper parent-child relationship in the stack
This is equivalent to using the gt create
command in the Graphite CLI.
Automatic Restacking
One of the powerful features of Graphite is automatic restacking of child branches. When you modify a commit or create a new commit on a branch that has child branches, Graphite will attempt to automatically restack those child branches to maintain the proper relationships.
This means that changes to a parent branch will be propagated to all child branches, ensuring that each branch in the stack builds upon the latest changes in its parent.
Handling Conflicts During Restacking
If there are conflicts during the automatic restacking process, Tower will notify you and provide options for resolving them:
- The restacking operation will pause
- Tower will show the conflicting files
- You can resolve the conflicts using Tower's conflict resolution tools
- After resolving conflicts, you can continue the restacking process
Best Practices for Committing in Stacked Branches
When working with stacked branches in Graphite, consider these best practices:
- Keep commits focused on a single logical change
- Use descriptive commit messages that clearly explain the purpose of the change
- Prefer modifying (amending) the last commit rather than creating multiple small commits for the same logical change
- Regularly restack your branches to ensure they stay up-to-date with changes in their parent branches