Skip to main content

Module git

Module git 

Source

Structs§

BranchListResult
Result of listing branches for a repository
CommitEntry
A single commit entry from git log
DiffSummary
Diff statistics summary (files changed, insertions, deletions)
GitCache
Cache for git information with TTL
GitInfo
Git information for a working directory
GraphCommit
A single commit in the full graph (all branches)
GraphData
Full graph data for lane-based visualization
RemoteTrackingInfo
Remote tracking info for a branch
WorktreeEntry
Parsed worktree entry from git worktree list --porcelain

Functions§

ahead_behind
Get ahead/behind counts relative to a base branch
checkout_branch
Checkout (switch to) a local branch
create_branch
Create a new local branch (without checking it out)
delete_branch
Delete a local branch
extract_claude_worktree_name
Extract worktree name from a .claude/worktrees/{name} path segment
fetch_branch_diff_stat
Fetch diff statistics between two explicit branches (not using HEAD)
fetch_diff_stat
Fetch lightweight diff statistics between base branch and HEAD
fetch_full_diff
Fetch full diff content between base branch and HEAD (on-demand)
fetch_remote
Fetch from a remote (default: origin)
is_safe_git_ref
Validate a git ref name (branch/tag) for safe use as a command argument
is_valid_worktree_name
Validate a worktree name (alphanumeric, hyphens, and underscores only, max 64 chars)
list_branches
List branches for a repository and detect the default branch
list_worktrees
List all worktrees for a repository by running git worktree list --porcelain
log_commits
Get commit log between two branches (base..branch)
log_graph
Get full commit graph across all branches for lane-based visualization
merge_branch
Merge a branch into the current branch
pull
Pull from upstream (fetch + merge)
repo_name_from_common_dir
Extract repository name from a git common directory path
strip_git_suffix
Strip /.git or /.git/ suffix from a path to get the repository root