---
title: "Checkout a GitHub repository"
method: POST
path: "/v1/git/checkout/{org}/{repo}"
tags: ["git"]
---

# Checkout a GitHub repository

`POST /v1/git/checkout/{org}/{repo}`

Clones a GitHub repository as a bare repo and creates initial worktree

## Path parameters

- `org` string, required
- `repo` string, required

## Query parameters

- `branch` string

## Response `200`

OK

- InternalHandlersCheckoutResponse — Response containing repository and worktree information after checkout
  - `message` string — Success message
  - `repository` GithubComVanpeltCatnipInternalModelsRepository — Git repository information and metadata
    - `available` boolean — Whether the repository is currently available on disk
    - `created_at` string — When this repository was first cloned
    - `default_branch` string — Default branch name for this repository
    - `description` string — Repository description
    - `has_github_remote` boolean — Whether the remote origin is a GitHub repository
    - `id` string — Repository identifier in owner/repo format
    - `last_accessed` string — When this repository was last accessed
    - `path` string — Local path to the bare repository
    - `remote_origin` string — Remote origin URL (may be different from URL for local repos)
    - `url` string — Full GitHub repository URL
  - `worktree` GithubComVanpeltCatnipInternalModelsWorktree — Git worktree with branch and status information
    - `branch` string — Current git branch name in this worktree
    - `claude_activity_state` 'inactive' | 'running' | 'active'
    - `commit_count` integer — Number of commits ahead of the divergence point (CommitHash)
    - `commit_hash` string — Commit hash where this worktree diverged from source branch (updated after merges)
    - `commits_behind` integer — Number of commits the source branch is ahead of our divergence point
    - `created_at` string — When this worktree was created
    - `has_active_claude_session` boolean — Whether there's an active Claude session for this worktree (deprecated - use ClaudeActivityState)
    - `has_been_renamed` boolean — Whether this worktree's branch has been renamed from its original catnip ref
    - `has_commits_ahead_of_remote` boolean — Whether the branch has commits ahead of the remote branch (calculated on list)
    - `has_conflicts` boolean — Whether the worktree is in a conflicted state (rebase/merge conflicts)
    - `id` string — Unique identifier for this worktree
    - `is_dirty` boolean — Whether there are uncommitted changes in the worktree
    - `last_accessed` string — When this worktree was last accessed
    - `latest_claude_message` string — Latest Claude message from the current session
    - `latest_claude_message_type` string — Type of the latest Claude message ("assistant" or "user")
    - `latest_session_title` string — Latest session title from the current session (simplified string version)
    - `latest_user_prompt` string — Latest user prompt from ~/.claude.json history
    - `name` string — User-friendly name for this worktree (e.g., 'vectorize-quasar')
    - `path` string — Absolute path to the worktree directory
    - `pull_request_body` string — Body/description of the associated pull request (persisted for updates)
    - `pull_request_last_synced` string — Last time the PR state was synced
    - `pull_request_state` string — State of the associated pull request (open, closed, merged)
    - `pull_request_title` string — Title of the associated pull request (persisted for updates)
    - `pull_request_url` string — URL of the associated pull request (if one exists)
    - `repo_id` string — Repository this worktree belongs to
    - `session_title` GithubComVanpeltCatnipInternalModelsTitleEntry
      - `commit_hash` string
      - `timestamp` string
      - `title` string
    - `session_title_history` GithubComVanpeltCatnipInternalModelsTitleEntry[] — History of session titles
      - `commit_hash` string
      - `timestamp` string
      - `title` string
    - `source_branch` string — Branch this worktree was originally created from
    - `todos` GithubComVanpeltCatnipInternalModelsTodo[] — Current todos from the most recent TodoWrite in Claude session
      - `content` string — The content/description of the todo
      - `id` string — Unique identifier for the todo item
      - `priority` 'high' | 'medium' | 'low' — Priority level of the todo
      - `status` 'pending' | 'in_progress' | 'completed' — Current status of the todo

---

[API](https://skmtc.net/wandb/apis/catnip-container-api.md) · [All operations](https://skmtc.net/wandb/apis/catnip-container-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wandb/catnip-container-api/versions/a075b0fa501a/schema)
