Skip to main content

Module git

Module git 

Source
Expand description

Git operations for branch management and merging.

§Doc Audit

  • audited: 2026-01-25
  • docs: reference/git.md
  • ignore: false

Structs§

CommitInfo
Information about a single git commit.
MergeAttemptResult
Result of a merge attempt with conflict details.
MergeResult
Result of a merge operation.
RebaseResult
Result of a rebase operation

Functions§

branch_exists
Check if a branch exists in the repository.
can_fast_forward_merge
Check if branch can be fast-forward merged into target branch. Returns true if the merge can be done as a fast-forward (no divergence).
count_commits
Count number of commits in branch.
delete_branch
Delete a branch, removing associated worktrees first. Returns Ok(()) on success, or an error if deletion fails.
ensure_on_main_branch
Ensure the main repo is on the main branch.
format_merge_summary
Format the merge result as a human-readable summary.
get_commit_changed_files
Get files changed in a specific commit.
get_commit_files_with_status
Get files changed in a commit with their status (A/M/D).
get_commits_for_path
Get commits that modified a specific path.
get_commits_in_range
Get commits in a range between two refs.
get_conflicting_files
Get list of files with conflicts from git status
get_current_branch
Get the current branch name. Returns the branch name for the current HEAD, including “HEAD” for detached HEAD state.
get_file_at_commit
Get file content at a specific commit.
get_file_at_parent
Get file content at parent commit.
get_git_config
Get a git config value by key.
get_git_user_info
Get git user name and email from config.
get_recent_commits
Get the N most recent commits.
is_branch_behind
Check if branch is behind target branch. Returns true if target has commits that branch doesn’t have.
is_branch_merged
Check if a branch has been merged into a target branch.
merge_single_spec
Merge a single spec’s branch into the main branch.
rebase_abort
Abort an in-progress rebase
rebase_branch
Rebase a branch onto another branch. Returns RebaseResult with success status and any conflicting files.
rebase_continue
Continue a rebase after conflicts have been resolved
stage_file
Stage a file for commit