Managing Granular Changes in Tower: Partial Staging and Stash Organization
Learn how to use Tower's partial staging and named stashes to maintain clean, atomic commits and organize work-in-progress changes without CLI complexity.
16 Jun 2026, 21:32 UTC

Solving the 'All-or-Nothing' Commit Problem
A common friction point in Git workflows is the "dirty file" dilemma: you have modified a file to implement a new feature, but you also added temporary debugging logs or unrelated formatting changes that should not be committed. Standard Git commands often force you to stage the entire file or use the cumbersome git add -p interactive mode in the terminal.
The primary takeaway for Tower users is the ability to perform Partial Staging. This allows you to isolate specific lines or "hunks" (contiguous blocks of changes) for a commit while leaving other changes in the same file as unstaged. This ensures that every commit remains atomic and focused, reducing noise in the project history.
Executing Partial Staging via the Working Copy
Tower handles partial staging through a visual diff engine integrated directly into the Working Copy view. Instead of marking a file as staged, you interact with the code changes themselves.
Step-by-Step Configuration
- Open the Working Copy sidebar to see the list of modified files.
- Select a modified file to open the Diff View. This view shows the current state of the file compared to the
HEADcommit. - Identify the specific lines you want to commit. In the gutter (the area next to the line numbers), click the Stage Line or Stage Hunk button.
- Observe the file status: the file will now appear in both the "Staged" and "Unstaged" sections of the Working Copy, indicating a partial stage.
- Enter your commit message and confirm. Only the selected lines are recorded in the commit; the remaining changes stay in your working directory.
Example Scenario: Removing Debugging Logs
Imagine a UserController.js file with the following changes:
// Line 10: Added validation logic (Keep this)
if (!user.email) throw new Error('Email required');
// Line 15: Added console log for debugging (Discard this)
console.log('DEBUG: User object is', user);
In Tower, you would click the stage button only for Line 10. When you commit, the validation logic is pushed to the repository, but the console.log remains in your local environment, preventing accidental leaks of debug code into production.
Organizing Context with Named Stashes
When you need to switch branches but aren't ready to commit your partial changes, the Stash feature acts as a temporary clipboard for your working directory. While git stash in the CLI creates a stack of unnamed entries, Tower allows for named stashes.
To use this, right-click your current changes and select Stash Changes. Provide a descriptive name, such as "fixing-auth-bug-halfway". This transforms the stash from a chronological list into a searchable library of context, making it easier to retrieve specific work-in-progress states across different feature branches.
Limitations and Common Pitfalls
While visual staging simplifies the process, there are technical constraints and risks to consider:
- Dependency Blindness: Staging a line of code without staging the variable declaration it relies on (located elsewhere in the file) will result in a commit that breaks the build. Always verify the resulting commit's logic.
- Performance with Large Binaries: Tower's diff engine is optimized for text. If your repository contains very large binary files (e.g., 100MB+ assets), the Working Copy view may lag or fail to render the diff, requiring you to stage those files in their entirety.
- GUI Abstraction: Relying solely on drag-and-drop for operations like cherry-picking or rebasing can obscure the underlying Git logic. If a merge conflict occurs during a GUI operation, you may still need to resolve the markers manually in a text editor.
Verification Checklist
To ensure your partial staging was successful, perform these checks:
- Check the Commit: After committing, view the commit in the history. Verify that only the intended lines appear in the diff.
- Verify Working Copy: Ensure the "unwanted" changes are still present in your local file and have not been accidentally deleted or committed.
- Stash Recovery: If using named stashes, apply the stash and verify that the file state returns exactly to where it was before the stash operation.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.