Overview
Thegitsw command provides a comprehensive set of options for branch management, organized into three main categories: switching operations, information display, and behavior flags.
Basic Usage
Arguments
Target branch to switch to. If omitted, gitsw launches an interactive branch picker with fuzzy search.Examples:
Switching Options
Options that control branch switching behavior:Create the target branch if it doesn’t exist. Without this flag, switching to a non-existent branch will fail.Examples:
Pull the latest changes from the remote repository after switching branches. Useful for keeping branches up to date.Examples:
Track and switch to a remote branch. Automatically fetches from the remote, creates a local tracking branch if needed, and switches to it.Format:
REMOTE/BRANCHExamples:Information Display Options
Options for viewing branch and repository status:Show current status including active branch, uncommitted changes, stash state, package manager, and remote tracking information.Example output:
Show the 10 most recently visited branches, sorted by last access time. Includes stash indicators and timestamps.Example output:
List all branches that have gitsw-managed stashes. Shows stash status (present/missing) and last visited time.Example output:
Branch Management Options
Delete a local branch and clean up any associated stashes. Cannot delete the currently active branch. Prompts for confirmation if the branch has a stash.Examples:
Behavior Flags
Flags that modify default gitsw behavior:Skip automatic stash behavior when switching branches. By default, gitsw prompts to stash uncommitted changes. This flag disables that behavior.Warning: May cause branch switch to fail if there are conflicts with uncommitted changes.Example:
Skip automatic package installation prompts. By default, gitsw detects lock file changes and prompts to run the package manager’s install command.Example:
Version and Help
Print help information showing all available options and usage examples.
Print the current version of gitsw.