Skip to main content

Module git

Module git 

Source

Structs§

CommitInfo
A single git commit
DiffEntry
A single entry from a git diff operation.

Enums§

CommitResult
Result type for commit operations
DiffStatus
Status of a file in a git diff.
PushResult
Result type for push operations

Functions§

branch_exists
Check if a branch exists (locally or remotely)
checkout
Checkout an existing branch
commit_and_push_pr_fixes
Commit and optionally push PR review fixes
create_commit
Create a git commit with the given message
current_branch
Get the current branch name
detect_base_branch
Detect the default base branch for the repository (main or master).
ensure_branch
Create and checkout a new branch, or checkout existing branch
get_branch_commits
Get commits specific to the current branch (excluding merge commits).
get_commit_diff
Get the diff for a specific commit.
get_current_branch_commits
Get commits specific to the current branch, auto-detecting the base branch.
get_diff_since
Get file changes since a specific commit.
get_head_commit
Get the full commit hash of HEAD.
get_merge_base
Get the merge-base commit between the current branch and base branch.
get_merge_base_auto
Get the merge-base commit, auto-detecting the base branch.
get_new_files_since
Get newly created files since a specific commit.
get_uncommitted_changes
Get uncommitted changes in the working directory.
has_uncommitted_changes
Check if there are uncommitted changes (staged or unstaged)
is_clean
Check if working directory is clean (no uncommitted changes)
is_git_repo
Check if current directory is a git repository
latest_commit_short
Get the short hash of the latest commit (HEAD)
push_branch
Push the current branch to origin with upstream tracking
stage_all_changes
Stage all changes (including new files, modifications, and deletions)