CCManager can display enhanced git status information for each worktree, including file changes, commits ahead/behind relative to parent branches, and parent branch context. This requires enabling Git's worktree configuration extension.
- File change counts:
+10 -5(additions/deletions) - Ahead/behind indicators:
↑3 ↓1(commits ahead/behind parent) - Parent branch name: Shown in dim text (e.g.,
main) - Accurate tracking: Each worktree remembers its parent branch
- Basic file changes:
+10 -5only - No ahead/behind information
- No parent branch tracking
To enable the full diff visualization features, run:
# Enable for current repository
git config extensions.worktreeConfig true
# Or enable globally for all repositories
git config --global extensions.worktreeConfig trueThe extensions.worktreeConfig setting enables Git to store configuration values specific to each worktree, rather than sharing them across all worktrees in a repository.
When enabled:
- Git creates a
.git/worktrees/<worktree-name>/config.worktreefile - Worktree-specific settings are stored separately from the main config
- Each worktree can have independent configuration values
CCManager uses this feature to:
- Store the parent branch name when creating a worktree
- Calculate accurate ahead/behind counts relative to the parent
- Display meaningful diff information for each worktree
Example workflow:
# Create a worktree from 'main' branch
$ ccmanager # Create worktree 'feature/login' from 'main'
# CCManager stores in worktree config:
# ccmanager.parentBranch = main
# Later, CCManager shows:
# feature/login [↑3 ↓1 main] +25 -10
# Meaning: 3 commits ahead, 1 behind main, with 25 additions and 10 deletions<branch-name> [<ahead-behind> <parent>] <file-changes>
Examples:
feature/auth [↑5 ↓2 develop] +120 -45- Feature branch ahead of develophotfix/security [↑1 main] +15 -3- Hotfix with changes ready to mergeexperiment/ai [↓10 main] +200 -50- Experimental branch behind main
- Green: Ahead commits (↑)
- Red: Behind commits (↓)
- Dim: Parent branch name
- Default: File changes
Know immediately which branch your worktree was created from, essential for:
- Understanding merge direction
- Identifying stale branches
- Planning rebases
Without worktree config, CCManager would need to guess or use a default branch (like main), which may not reflect the actual parent relationship.
Each worktree maintains its own parent reference, allowing:
- Multiple worktrees from different parents
- Accurate tracking even after branch renames
- Preservation of workflow context
When you create a worktree with CCManager:
# Stored in .git/worktrees/<name>/config.worktree
[ccmanager]
parentBranch = mainCCManager runs these git commands internally:
# Get file changes
git diff --shortstat
# Get ahead/behind counts (when parent is known)
git rev-list --left-right --count <parent>...<current-branch>If worktree config is not enabled:
- File changes are still shown
- Ahead/behind information is omitted
- No error messages displayed
- Feature degrades gracefully
cd my-project
git config extensions.worktreeConfig true
ccmanager # Now with full status tracking# Enable the extension
git config extensions.worktreeConfig true
# Recreate worktrees or manually set parent branches
git config --worktree ccmanager.parentBranch mainFor developers who frequently use worktrees:
git config --global extensions.worktreeConfig true- Check if worktree config is enabled:
git config extensions.worktreeConfig
- Verify parent branch is set:
git config --worktree ccmanager.parentBranch
Manually update the parent branch:
git config --worktree ccmanager.parentBranch developThe ahead/behind calculation is fast for most repositories but may be slower for:
- Very large repositories
- Branches with extensive divergence
- Repositories with deep history
In these cases, the status might show a loading indicator briefly.
- Enable Early: Set up worktree config when starting a new project
- Global Setting: Consider enabling globally if you use worktrees frequently
- Team Consistency: Document this requirement in your team's setup guide
- CI/CD: Ensure build systems have this enabled for accurate status reporting