Welcome to gitsw
gitsw is a contextual Git branch switcher that makes working with multiple branches effortless. It automatically manages your uncommitted changes, restores your workspace state, and keeps your dependencies in sync.Installation
Get started with gitsw using cargo, install script, or pre-built binaries
Quick Start
Learn the basics and start switching branches in minutes
Key Features
Discover what makes gitsw powerful
What is gitsw?
gitsw enhances the Git branch switching experience by automatically handling the tedious tasks developers face when moving between branches:- Stashing uncommitted changes when you leave a branch
- Restoring those changes when you return
- Detecting package manager changes and prompting for dependency installation
- Providing an interactive fuzzy-search interface for branch selection
Key Features
Interactive Branch Picker
Fuzzy search through all your branches with the most recently used ones displayed first. No need to remember exact branch names.Smart Dependency Sync
Detects changes to lock files (package-lock.json, yarn.lock, pnpm-lock.yaml) and prompts you to run the appropriate package manager install command.
Recent Branches Tracking
Quickly access your most recently used branches with timestamps and stash indicators.Branch Operations
- Create new branches with
-cflag - Pull latest changes after switching with
-pflag - Delete branches with automatic stash cleanup
- View current status including branch, changes, and stash state
How It Works
gitsw maintains state in.git/git-switch.json within your repository to track:
- Branch state: Last visited time, stash ID, and lock file hash for each branch
- On branch leave: If you have uncommitted changes, gitsw stashes them with a branch-specific identifier
- On branch switch: Git checks out the target branch
- On branch return: If a stash exists for the branch, gitsw automatically applies and drops it
- Lock file check: Compares lock file hash with stored value and prompts for install if changed
Next Steps
Install gitsw
Choose your preferred installation method
Quick Start Guide
Get up and running in minutes