Git Switch

Switch Git branches while stashing, carrying, or discarding uncommitted changes.

1|1|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/dtsong/claude-code-windows-setup --skill git-switch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Git Switch
Source: https://github.com/dtsong/claude-code-windows-setup/tree/main/skills/git-workflows/skills/switch
Command: npx skills add https://github.com/dtsong/claude-code-windows-setup --skill git-switch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps you switch between Git branches without losing uncommitted changes, preventing accidental data loss or merge conflicts.

Core Features & Use Cases

  • Safe Branch Switching: Handles uncommitted changes by offering to stash, carry, or discard them.
  • Branch Creation: Allows creating new branches directly during the switch command.
  • Use Case: You're working on a feature, need to quickly check something on main, and have some uncommitted edits. This skill lets you switch to main safely, stashing your changes, and then helps you restore them when you switch back.

Quick Start

Use the git switch skill to switch to the main branch.

Frequently Asked Questions about Git Switch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I switch git branches without losing uncommitted changes?

To switch git branches without losing uncommitted changes, this skill manages your local edits by offering options to stash, carry over, or discard them before safely executing the branch switch.

What is the safest way to stash and restore changes when switching git branches?

The safest way to stash changes when switching git branches is using a workflow that automatically handles uncommitted edits, stashing them during the switch and helping you restore them when you return.

How do I create a new git branch and switch to it while I have working changes?

To create a new git branch and switch to it with working changes, this skill allows direct branch creation during the switch command and prompts you to stash, carry, or discard existing edits.

Does this branch switching method validate local and remote branch existence?

Yes, safe branch switching validates branch existence both locally and on the remote origin before execution, ensuring you only switch to branches that actually exist in your git repository.

Can I quickly switch back to the previous git branch after checking main?

Yes, you can quickly switch back to the previous git branch after checking main, as this skill supports switching directly to the previous branch to streamline your development workflow.