All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Post-hook support for
startandcheckoutcommands (idea thanks to @pnikonowicz in #20)post_start_hookandpost_checkout_hookconfiguration options in.gwrc- Hook commands are executed via
sh -cwith environment variables:GW_WORKTREE_PATH,GW_BRANCH_NAME,GW_REPO_NAME,GW_COMMAND - Enables integration with tmux, iTerm2, or any custom workflow
- Hook failures are treated as warnings and do not block command execution
- Example hook scripts for tmux and iTerm2 included in
examples/hooks/
- Zsh completion support via shell integration
gw endcompletes with worktree branch namesgw checkoutcompletes with remote branch names (origin)- Subcommand names with descriptions are also completed
- New
fetch_before_commandconfiguration option (default:true)- Automatically runs
git fetch --all --prunebeforestart,end,checkout, andcleancommands - Ensures remote branch information is up-to-date for accurate branch existence checks and merge status detection
--no-fetchflag available on all four commands to temporarily skip fetching- Fetch failures are treated as warnings and do not block command execution
- Configurable via
gw configorgw init
- Automatically runs
- Fix
gw startcreating incorrectly named worktree directories when run from within a worktree- Previously running
gw start 456from withingw-123worktree would creategw-123-456 - Now always creates
{original-repo}-{issue}regardless of current directory (e.g.,gw-456) - Uses
git rev-parse --git-common-dirto resolve the original repository name
- Previously running
- Fix
gw startfailing when base branch exists only on remote (not locally)- Now automatically resolves
origin/<branch>when the specified base branch doesn't exist locally but exists on remote - Allows using fetched remote branches without needing to create local tracking branches first
- Now automatically resolves
- CLI spinner for long-running operations
- Shows animated spinner during worktree creation, removal, safety checks, and branch fetching
- Automatically disabled for non-TTY environments and respects
NO_COLOR - Falls back to simple text messages when spinner cannot be displayed
- Colored output for status symbols (✓/✗/⚠/→) using lipgloss
- Automatically respects
NO_COLORenvironment variable and terminal capabilities
- Automatically respects
- New
gw cleancommand to batch remove merged worktrees- Safely removes multiple worktrees that have been merged to origin/main
- Performs the same safety checks as
gw end: uncommitted changes, unpushed commits, and merge status - Only removes worktrees that pass all three safety checks
--forceflag to skip confirmation prompt--dry-runflag to preview what would be removed without making changes- Displays concise summary showing only directory names instead of full paths
- Shows clear reasons for non-removable worktrees with visual separator (→)
- Multiple reasons are combined into a single line for better readability
- User-friendly error messages for broken worktrees (shows "invalid git repository" instead of cryptic "exit status 128")
- Respects
auto_remove_branchconfiguration for automatic branch cleanup
- Add
copy_envsconfiguration option for automatic .env file copying behavior- Configure default behavior in
~/.gwrcto avoid interactive prompts - Three-tier priority system:
--copy-envsflag > config setting > interactive prompt - When unset, maintains existing interactive prompt behavior
- Can be toggled in
gw configinteractive UI orgw initsetup wizard
- Configure default behavior in
- Fix
gw endincorrectly warning about unpushed commits for merged branches with deleted remotes- The command now correctly detects when a branch has been merged to main even if the remote branch was deleted
- This commonly occurs after PR merges with automatic branch deletion on GitHub
- Improved test coverage:
- internal/git package coverage increased to 94.6%
- internal/detect package coverage increased to 100%
- Updated README to include Composer in the list of supported package managers
- New
gw configcommand for viewing and editing configuration interactively- Interactive TUI with arrow/j/k navigation for browsing settings
- Toggle boolean values with Enter/Space keys
- Save changes with 's' key
- Non-interactive mode with
--listflag for CI/scripting - Shows configuration descriptions and default values
- Visual indicators (✅/❌) for boolean settings
- New
auto_remove_branchconfiguration option for automatic branch deletion- When enabled, automatically deletes the local branch after successful worktree removal
- Works similarly to GitHub's "Automatically delete head branches" feature
- Default value is false to avoid unexpected behavior
- Branch deletion errors are non-fatal and only show warnings
- Composer support for automatic dependency installation (Thanks @zonuexe! #10)
- Detects PHP projects with composer.json
- Automatically runs
composer installwhen setting up worktrees
- Improved test coverage significantly:
- Added comprehensive tests for DefaultClient in interface.go
- Increased internal/git package coverage from 42.9% to 79.2%
- Added tests for config Update method
- Added tests for gw config command
- Configuration file support via
~/.gwrc - New
gw initcommand for interactive configuration setup - Auto-cd configuration option to control directory change behavior after worktree creation
- New
gw shell-integrationcommand with multiple features:--show-scriptflag to dynamically generate shell integration code--shellparameter to specify shell type (bash/zsh/fish)--print-pathflag to get worktree paths for specific issues/branches- Supports eval-based setup for always up-to-date shell integration
- Test coverage reporting with Codecov integration
- GitHub Actions workflow for automated test coverage
- Makefile commands for local coverage reporting (
make coverage,make coverage-report) - iTerm2 tab name update feature:
- New
update_iterm2_tabconfiguration option (default: false) - Automatically updates tab name to "{repo name} {issue num/branch}" when creating/switching worktrees
- Resets tab name when removing worktrees
- Works with
gw start,gw checkout, andgw endcommands - Only active when running in iTerm2 terminal
- New
- Support for custom branch names in
gw startcommand:- Accepts full branch names (e.g.,
gw start 476/impl-migration-script) - Only appends
/implto pure numbers (e.g.,gw start 123→ branch123/impl) - Properly sanitizes branch names for directory creation
- Accepts full branch names (e.g.,
- Refactored cmd package to use dependency injection pattern for better testability
- Test coverage increased from ~20% to 71.2%
- Worktrees are now created relative to repository root directory, not current working directory
- Fix
gw startcommand failing to find environment files (exit status 128) - Use original repository root for env file search in
gw startcommand - Ensure only untracked env files are copied (exclude .env.example and similar tracked files)
- Show environment files list before confirmation prompt in both
startandcheckoutcommands
- Add
--copy-envsflag tostartandcheckoutcommands to copy untracked .env files - Interactive prompt to copy environment files when
--copy-envsflag is not specified - Automatic detection of untracked .env files (excluding .git, node_modules, vendor, dist, build directories)
- Display list of environment files to be copied before copying
- Add
BranchExistsfunction to validate branch existence before checkout
- Show environment files list before confirmation prompt for better UX
- Use original repository root for finding env files in checkout command
- Include non-numeric branches in
gw endinteractive mode (now shows all branches with "/impl" pattern) - Improve error message for non-existent branches in checkout command
- Handle CI environments without remote branches in tests
- New
gw checkoutcommand to create worktrees from existing branches - Interactive branch selection when no branch is specified for checkout
- Support for checking out both local and remote branches
- Automatic creation of tracking branches for remote branches
- Proper sanitization of branch names for directory creation (handles special characters like /, , *, ?, <, >, |, :, ")
- Update module path from
gwtogithub.com/sotarok/gwfor go install compatibility - Fix import paths throughout the codebase
- Fix Go version in go.mod (was incorrectly set to 1.24.5)
- Add coverage.txt to .gitignore
- Add pre-commit checklist to CLAUDE.md (run
make fmtandmake checkbefore committing)
- Initial implementation of
gw startcommand for creating worktrees - Initial implementation of
gw endcommand for removing worktrees - Interactive worktree selection when no issue number is provided
- Automatic package manager detection and setup (npm, yarn, pnpm, cargo, go, pip, bundler)
- Safety checks before removing worktrees
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive test suite
- GitHub Actions CI/CD pipeline
- GoReleaser configuration for automated releases
- Deep copy of PackageManager structs to prevent global state mutation