Quick Start
This guide will help you start using gitsw to switch branches with automatic stash management.Prerequisites
Make sure you have:- Installed gitsw
- A Git repository to work with
Basic Usage
Interactive Branch Selection
Run This opens a fuzzy-search interface showing all your branches with recent ones listed first. Use:
gitsw without arguments to launch the interactive branch picker:- Arrow keys to navigate
- Type to filter branches
- Enter to select and switch
Direct Branch Switch
Switch to a specific branch by name:If you have uncommitted changes, gitsw will prompt you:Choose “Stash changes” and gitsw will:
- Automatically stash your changes with a branch-specific identifier
- Switch to the target branch
- Restore the changes when you return to the original branch
Common Workflows
Create a New Branch
Create and switch to a new branch in one command:Pull Latest Changes
Switch to a branch and pull the latest changes:Track a Remote Branch
Fetch and track a remote branch:- Fetch from the remote
- Create a local tracking branch
- Switch to the new branch
View Recent Branches
See your recently used branches with timestamps:[stash] indicator shows branches with saved changes.
Check Current Status
View your current branch status including changes and stashes:Package Manager Detection
When you switch branches, gitsw automatically detects changes to lock files and prompts you to install dependencies:- npm (
package-lock.json) - yarn (
yarn.lock) - pnpm (
pnpm-lock.yaml)
Use
--no-install to skip the automatic install prompt if needed.Skip Automatic Features
You can disable automatic stashing or installation when needed:List All Branches with Stashes
See which branches have saved stashes:Delete a Branch
Delete a branch and automatically clean up its stash:Next Steps
Now that you know the basics:Configuration Options
Explore all available command-line options and flags
Command Reference
Learn about all commands and advanced features