Expand description
Git operations for branch management and merging.
§Doc Audit
- audited: 2026-01-25
- docs: reference/git.md
- ignore: false
Structs§
- Commit
Info - Information about a single git commit.
- Merge
Attempt Result - Result of a merge attempt with conflict details.
- Merge
Result - Result of a merge operation.
- Rebase
Result - 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