Git Switch

Switch between branches with safety checks.

Andersonlimahw Updated

File contents

Git Switch Skill

Switch git branches using the modern git switch command.

Capabilities

  • Switch to branch: git switch <branch>
  • Create and switch: git switch -c <new-branch>
  • Create from commit: git switch -c <new-branch> <commit>
  • Detach HEAD: git switch --detach <commit>
  • Switch to previous: git switch - (dash for previous branch)
  • Force switch: git switch -f <branch> (discard local changes)
  • Switch with merge: git switch -m <branch> (merge local changes)
  • Show progress: git switch --progress <branch>

Usage

Triggered when user says "switch branch", "checkout branch", "change branch", "go to branch". Warn about uncommitted changes before switching. Use - to toggle between two branches.

Andersonlimahw/lemon-ai-hub/tree/main/plugins/git-expert/skills/git-switch commit 0d9c2c1308

Frequently asked questions

npx skillmds@latest add andersonlimahw/git-switch