git_checkout

Checkout a Git branch or commit with uncommitted change safeguards.

8|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/OpenAuthority/clawthority --skill git-checkout
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git_checkout
Source: https://github.com/OpenAuthority/clawthority/tree/main/examples/skills/git_checkout
Command: npx skills add https://github.com/OpenAuthority/clawthority --skill git-checkout

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Switches the working directory to a specified branch or commit in a git repository. It enables you to move the repository state to a target ref, with safeguards for missing refs or uncommitted changes.

Core Features & Use Cases

  • Checkout a specific branch or commit by providing its ref.
  • Use cases include switching to a feature branch, inspecting a past commit in detached HEAD state, or returning to the main branch.
  • Returns the checked-out ref and a status message, and raises errors for missing refs or uncommitted changes.

Quick Start

Checkout a branch or commit by providing its ref.

Frequently Asked Questions about git_checkout

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

FAQPage Schema
How do I switch to a different git branch in my repository?

To switch a git branch, specify the target branch ref to checkout. The operation moves the working directory state to that branch and returns the checked-out ref with a status message.

Can I checkout a specific historical commit without switching branches?

Yes, you can checkout a specific commit by providing its ref. This places the repository in a detached HEAD state, allowing you to inspect historical repository changes safely.

What happens if I try to checkout a branch with uncommitted changes?

The checkout operation detects uncommitted changes and blocks the switch. You must commit or stash modifications before changing branches to prevent losing work.

How do I return to the main branch after checking out a feature branch?

Provide the main branch ref to checkout. This switches the working directory back from a feature branch or detached HEAD state to the main development line.

Why does my git checkout fail when the target ref does not exist?

Git checkout fails for missing refs because the target branch or commit cannot be found. The operation requires the specified ref to exist in the repository before switching.

What is detached HEAD state and when do I need it for version control?

Detached HEAD state occurs when you checkout a commit instead of a branch. It is needed to inspect past repository states without altering branch history.