Skip to main content

Module git

Module git 

Source

Functionsยง

branch_sha
The commit a branch points at, or None when the branch does not exist.
checkout
commits_behind
How many commits parent has that branch does not: nonzero means the branch needs a restack.
config_get
config_get_bool
config_get_regexp
config_set
config_unset
create_branch
current_branch
delete_branch
Force-delete a branch. Callers are expected to have verified the branch landed through review state: after a squash merge its commits are not ancestry-merged, so git branch -d can refuse even though the work is in.
fetch_branch
Fast-forward a local branch from its remote without checking it out.
git_path
is_ancestor
local_branches
merge_base
pull_ff_only
push_force_with_lease
push_set_upstream_force_with_lease
Push branches and set upstream tracking; used before submitting so new branches exist remotely and rebased ones are safely updated.
rebase
rebase_abort
rebase_continue
rebase_onto
Rebase only the commits after base, replaying base..branch onto parent. Used when the recorded fork point is known so commits that landed upstream by squash or rebase are not replayed.
remote_default_branch
Default branch of remote (from its locally-known HEAD symref), if any.
remote_url
rename_branch
Rename a branch; git moves its branch.<name>.* config along with it.
reset_hard
Reset the worktree and index to HEAD. Safe to lose nothing only on a clean tree; callers must check worktree_is_clean first.
rev_parse
set_verbose
Pass raw git output through instead of capturing it.
supports_rebase_update_refs
update_ref
Point a branch at a commit, creating it if absent. Does not touch the worktree.
worktree_is_clean
Whether the worktree and index have no uncommitted changes.