Expand description
Reusable git, worktree, sync, rebase, and squash-merge orchestration.
Structs§
- Real
GitClient - Production
GitClientimplementation backed by real git commands.
Enums§
- GitError
- Re-exported typed error for git infrastructure operations. Typed error returned by git infrastructure operations.
- Pull
Rebase Result - Re-exported commit/sync/diff APIs.
Result of attempting
git pull --rebase. - Rebase
Step Result - Re-exported rebase/conflict APIs. Result of attempting a rebase step.
- Single
Commit Message Strategy - Re-exported commit/sync/diff APIs.
Controls how single-commit session branches treat the commit message when
amending
HEAD. - Squash
Merge Outcome - Re-exported squash-merge APIs. Outcome of attempting a squash merge operation.
Traits§
- GitClient
- Low-level async git boundary used by app orchestration code.
Functions§
- abort_
rebase - Re-exported rebase/conflict APIs. Aborts an in-progress rebase.
- branch_
tracking_ statuses - Re-exported commit/sync/diff APIs.
Returns ahead/behind snapshots for every local branch in
repo_path. - commit_
all - Re-exported commit/sync/diff APIs. Stages all changes and commits them with the given message.
- commit_
all_ preserving_ single_ commit - Re-exported commit/sync/diff APIs. Stages all changes and keeps a single commit for the provided message.
- create_
worktree - Re-exported worktree and branch-detection APIs. Creates a git worktree at the specified path with a new branch.
- current_
upstream_ reference - Re-exported commit/sync/diff APIs.
Returns the current upstream reference for
HEAD. - delete_
branch - Re-exported commit/sync/diff APIs. Deletes a git branch.
- detect_
git_ info - Re-exported worktree and branch-detection APIs. Detects git repository information for the given directory. Returns the current branch name if in a git repository, None otherwise.
- diff
- Re-exported commit/sync/diff APIs.
Returns the output of
git difffor the given repository path, showing all changes (committed and uncommitted) relative to the base branch. - fetch_
remote - Re-exported commit/sync/diff APIs. Fetches from the configured remote.
- find_
git_ repo_ root - Re-exported worktree and branch-detection APIs. Walks up the directory tree to find a .git directory. Returns the directory containing .git (the repository root) if found, None otherwise.
- get_
ahead_ behind - Re-exported commit/sync/diff APIs. Returns the number of commits ahead and behind the upstream branch.
- get_
ref_ ahead_ behind - Re-exported commit/sync/diff APIs.
Returns the number of commits
left_refis ahead of and behindright_ref. - has_
commits_ since - Re-exported commit/sync/diff APIs.
Returns whether
HEADcontains commits that are not reachable frombase_branch. - has_
unmerged_ paths - Re-exported rebase/conflict APIs. Returns whether unresolved paths still exist in the index.
- head_
commit_ message - Re-exported commit/sync/diff APIs.
Returns the full
HEADcommit message, orNonewhen no commits exist. - head_
hash - Re-exported commit/sync/diff APIs.
Returns the full hash of the current
HEADcommit. - head_
short_ hash - Re-exported commit/sync/diff APIs.
Returns the short hash of the current
HEADcommit. - is_
rebase_ in_ progress - Re-exported rebase/conflict APIs. Returns whether a rebase is currently in progress in the repository or worktree.
- is_
worktree_ clean - Re-exported commit/sync/diff APIs. Returns whether a repository or worktree has no uncommitted changes.
- list_
conflicted_ files - Re-exported rebase/conflict APIs. Returns conflicted file paths for the current index.
- list_
local_ commit_ titles - Re-exported commit/sync/diff APIs. Returns local commit subjects that are not yet present in upstream.
- list_
staged_ conflict_ marker_ files - Re-exported rebase/conflict APIs.
Returns which of the given
pathsstill contain git conflict markers (<<<<<<<) in their staged content. - list_
upstream_ commit_ titles - Re-exported commit/sync/diff APIs.
Returns upstream commit subjects that are not yet in local
HEAD. - main_
repo_ root - Re-exported repository metadata APIs. Resolves the main repository root for a repository or linked worktree.
- pull_
rebase - Re-exported commit/sync/diff APIs.
Runs
git pull --rebaseand returns conflict outcome when applicable. - push_
current_ branch - Re-exported commit/sync/diff APIs.
Pushes the current branch to its upstream remote with
--force-with-lease. - push_
current_ branch_ to_ remote_ branch - Re-exported commit/sync/diff APIs.
Pushes the current branch to one explicit remote branch name with
--force-with-leaseand returns the resulting upstream reference. - rebase
- Re-exported rebase/conflict APIs.
Rebases the current branch onto
target_branch. - rebase_
continue - Re-exported rebase/conflict APIs. Continues an in-progress rebase.
- rebase_
onto_ start - Re-exported rebase/conflict APIs.
Starts a rebase that moves commits after
old_baseontonew_base. - rebase_
start - Re-exported rebase/conflict APIs.
Rebases the current branch onto
target_branch. - ref_
hash - Re-exported commit/sync/diff APIs. Returns the full commit hash for a git reference.
- remote_
branch_ exists - Re-exported commit/sync/diff APIs. Checks whether a branch already exists on the remote.
- remove_
worktree - Re-exported worktree and branch-detection APIs. Removes a git worktree at the specified path.
- repo_
url - Re-exported repository metadata APIs. Returns the origin repository URL normalized to HTTPS form when possible.
- squash_
merge - Re-exported squash-merge APIs. Performs a squash merge from a source branch to a target branch.
- squash_
merge_ diff - Re-exported squash-merge APIs. Returns the full patch diff that will be squashed when merging a source branch into a target branch.
- stage_
all - Re-exported commit/sync/diff APIs. Stages all changes in the repository or worktree.
- tracked_
worktree_ status - Re-exported commit/sync/diff APIs. Returns a stable porcelain status snapshot for tracked worktree files only.
- worktree_
status - Re-exported commit/sync/diff APIs. Returns a stable porcelain status snapshot for a repository or worktree.
Type Aliases§
- Branch
Tracking Map - Re-exported commit/sync/diff APIs.
Map of local branch names to their ahead/behind counts relative to their
tracked upstream branch.
Noneindicates no upstream or a gone upstream. - GitFuture
- Boxed async result used by
GitClienttrait methods.