Skip to main content

Module git

Module git 

Source
Expand description

Git utility functions for the Sprite multi-agent workflow toolkit.

This module provides functions for managing git repositories, worktrees, branches, and other git operations needed for agent workspace management.

Structs§

GitStatus
Git repository status information.
WorktreeInfo
Information about a git worktree.

Functions§

add
Add files to git staging area.
branch_exists
Check if a git branch exists.
checkout_branch
Checkout a branch in a specific path.
commit
Commit changes with a message.
create_branch
Create a new git branch.
create_branch_from
Create a new git branch from a specific starting point.
create_worktree
Create a git worktree for an agent.
delete_branch
Delete a git branch.
force_delete_branch
Force remove a git branch, even if it has unmerged changes.
get_branch_commit
Get the current commit hash of a branch.
get_branches_containing_commit
Get a list of all branches that contain the given commit.
get_current_branch
Get the current git branch name.
get_current_branch_at
Get the current git branch name at a specific path.
get_current_commit
Get the current git commit hash.
get_git_root
Get the current git repository root directory.
get_remote_url
Get the git remote URL.
get_status
Get the git repository status.
get_status_at
Get the git repository status at a specific path.
get_status_string
Get the git repository status as a string.
get_status_string_at
Get the git repository status as a string at a specific path.
has_merge_conflicts
Check if there are merge conflicts after a merge operation.
has_uncommitted_changes
Check if a file has uncommitted changes.
is_branch_merged
Check if a branch has been merged into the current branch.
is_git_repository
Check if the current directory is a git repository.
is_git_repository_at
Check if a specific path is a git repository.
list_worktrees
List all git worktrees in the repository.
merge_branch
Merge a branch into the current branch.
prune_worktrees
Prune stale worktree references.
pull
Pull changes from the remote repository.
push
Push changes to the remote repository.
remove_worktree
Remove a git worktree.
remove_worktree_reference
Remove a worktree reference without removing the directory.
safe_delete_branch
Safely remove a git branch, checking if it’s merged first.
switch_branch
Switch to an existing git branch.
switch_branch_at
Switch to an existing git branch at a specific path.
validate_git_repository
Validate that we’re in a git repository.