Skip to content

git

git documentation

toolroom._stubs.git.Git

Bases: Tool[_R]

Add

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    all: Flag = ...,
    chmod: Flag = ...,
    dry_run: Flag = ...,
    edit: Flag = ...,
    force: Flag = ...,
    ignore_errors: Flag = ...,
    ignore_missing: Flag = ...,
    intent_to_add: Flag = ...,
    inter_hunk_context: Value = ...,
    interactive: Flag = ...,
    no_warn_embedded_repo: Flag = ...,
    patch: Flag = ...,
    pathspec_file_nul: Flag = ...,
    pathspec_from_file: Value = ...,
    refresh: Flag = ...,
    renormalize: Flag = ...,
    sparse: Flag = ...,
    unified: Value = ...,
    update: Flag = ...,
    verbose: Flag = ...,
    **flags: Any,
) -> _R2

Add file contents to the index

Parameters:

Name Type Description Default
all Flag

Update the index not only where the working tree has a file matching but also where the index already has an entry. all=off emits --ignore-removal.

...
chmod Flag

Override the executable bit of the added files.

...
dry_run Flag

Don't actually add the file(s), just show if they exist and/or will be ignored.

...
edit Flag

Open the diff vs. the index in an editor and let the user edit it.

...
force Flag

Allow adding otherwise ignored files.

...
ignore_errors Flag

If some files could not be added because of errors indexing them, do not abort the operation, but continue adding the others.

...
ignore_missing Flag

This option can only be used together with --dry-run.

...
intent_to_add Flag

Record only the fact that the path will be added later.

...
inter_hunk_context Value

Show the context between diff hunks, up to the specified of lines, thereby fusing hunks that are close to each other. Added in 2.51.0.

...
interactive Flag

Add modified contents in the working tree interactively to the index.

...
no_warn_embedded_repo Flag

By default, git add will warn when adding an embedded repository to the index without using git submodule add to create an entry in .gitmodules.

...
patch Flag

Interactively choose hunks of patch between the index and the work tree and add them to the index.

...
pathspec_file_nul Flag

Only meaningful with --pathspec-from-file.

...
pathspec_from_file Value

Pathspec is passed in instead of commandline args.

...
refresh Flag

Don't add the file(s), but only refresh their stat() information in the index.

...
renormalize Flag

Apply the "clean" process freshly to all tracked files to forcibly add them again to the index.

...
sparse Flag

Allow updating index entries outside of the sparse-checkout cone.

...
unified Value

Generate diffs with lines of context. Added in 2.51.0.

...
update Flag

Update the index just where it already has an entry matching .

...
verbose Flag

Be verbose.

...

Branch

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    C: Flag = ...,
    D: Flag = ...,
    M: Flag = ...,
    abbrev: Value = ...,
    all: Flag = ...,
    color: ValuedFlag = ...,
    column: ValuedFlag = ...,
    contains: Value = ...,
    copy: Flag = ...,
    create_reflog: Flag = ...,
    delete: Flag = ...,
    edit_description: Flag = ...,
    force: Flag = ...,
    format: Value = ...,
    ignore_case: Flag = ...,
    list: Flag = ...,
    merged: Value = ...,
    move: Flag = ...,
    no_abbrev: Flag = ...,
    no_color: Flag = ...,
    no_contains: Value = ...,
    no_merged: Value = ...,
    no_track: Flag = ...,
    omit_empty: Flag = ...,
    points_at: Value = ...,
    quiet: Flag = ...,
    recurse_submodules: Flag = ...,
    remotes: Flag = ...,
    set_upstream: Flag = ...,
    set_upstream_to: Value = ...,
    show_current: Flag = ...,
    sort: Value = ...,
    track: ValuedFlag = ...,
    unset_upstream: Flag = ...,
    verbose: Flag = ...,
    **flags: Any,
) -> _R2

List, create, or delete branches

Parameters:

Name Type Description Default
C Flag

Shortcut for --copy --force.

...
D Flag

Shortcut for --delete --force.

...
M Flag

Shortcut for --move --force.

...
abbrev Value

In the verbose listing that show the commit object name, show the shortest prefix that is at least hexdigits long that uniquely refers the object.

...
all Flag

List both remote-tracking branches and local branches.

...
color ValuedFlag

Color branches to highlight current, local, and remote-tracking branches. Value optional: True for the bare flag, or pass one.

...
column ValuedFlag

Display branch listing in columns. Value optional: True for the bare flag, or pass one.

...
contains Value

Only list branches which contain (HEAD if not specified).

...
copy Flag

Copy a branch, together with its config and reflog.

...
create_reflog Flag

Create the branch's reflog.

...
delete Flag

Delete a branch.

...
edit_description Flag

Open an editor and edit the text to explain what the branch is for, to be used by various other commands (e.g.

...
force Flag

Reset to , even if exists already.

...
format Value

A string that interpolates %(fieldname) from a branch ref being shown and the object it points at.

...
ignore_case Flag

Sorting and filtering branches are case insensitive.

...
list Flag

List branches.

...
merged Value

Only list branches whose tips are reachable from (HEAD if not specified).

...
move Flag

Move/rename a branch, together with its config and reflog.

...
no_abbrev Flag

Display the full sha1s in the output listing rather than abbreviating them.

...
no_color Flag

Turn off branch colors, even when the configuration file gives the default to color output.

...
no_contains Value

Only list branches which don't contain (HEAD if not specified).

...
no_merged Value

Only list branches whose tips are not reachable from (HEAD if not specified).

...
no_track Flag

Do not set up "upstream" configuration, even if the branch.autoSetupMerge configuration variable is set.

...
omit_empty Flag

Do not print a newline after formatted refs where the format expands to the empty string.

...
points_at Value

Only list branches of .

...
quiet Flag

Be more quiet when creating or deleting a branch, suppressing non-error messages.

...
recurse_submodules Flag

THIS OPTION IS EXPERIMENTAL! Cause the current command to recurse into submodules if submodule.propagateBranches is enabled.

...
remotes Flag

List or delete (if used with -d) the remote-tracking branches.

...
set_upstream Flag

As this option had confusing syntax, it is no longer supported.

...
set_upstream_to Value

Set up 's tracking information so is considered 's upstream branch.

...
show_current Flag

Print the name of the current branch.

...
sort Value

Sort based on .

...
track ValuedFlag

When creating a new branch, set up branch..remote and branch..merge configuration entries to set "upstream" tracking configuration for the new branch. Value optional: True for the bare flag, or pass one.

...
unset_upstream Flag

Remove the upstream information for .

...
verbose Flag

When in list mode, show sha1 and commit subject line for each head, along with relationship to upstream branch (if any).

...

Checkout

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    B: Value = ...,
    b: Value = ...,
    conflict: Value = ...,
    detach: Flag = ...,
    force: Flag = ...,
    guess: Flag = ...,
    ignore_other_worktrees: Flag = ...,
    ignore_skip_worktree_bits: Flag = ...,
    inter_hunk_context: Value = ...,
    l: Flag = ...,
    merge: Flag = ...,
    no_track: Flag = ...,
    orphan: Value = ...,
    ours: Flag = ...,
    overlay: Flag = ...,
    overwrite_ignore: Flag = ...,
    patch: Flag = ...,
    pathspec_file_nul: Flag = ...,
    pathspec_from_file: Value = ...,
    progress: Flag = ...,
    quiet: Flag = ...,
    recurse_submodules: Flag = ...,
    track: ValuedFlag = ...,
    unified: Value = ...,
    **flags: Any,
) -> _R2

Switch branches or restore working tree files

Parameters:

Name Type Description Default
B Value

The same as -b, except that if the branch already exists it resets to the start point instead of failing.

...
b Value

Create a new branch named , start it at , and check the resulting branch out; see git-branch(1) for details.

...
conflict Value

The same as --merge option above, but changes the way the conflicting hunks are presented, overriding the merge.conflictStyle configuration variable.

...
detach Flag

Rather than checking out a branch to work on it, check out a commit for inspection and discardable experiments.

...
force Flag

When switching branches, proceed even if the index or the working tree differs from HEAD, and even if there are untracked files in the way.

...
guess Flag

If is not found but there does exist a tracking branch in exactly one remote (call it ) with a matching name, treat as equivalent to $ git checkout -b --track / If the branch exists in multiple remotes and one of them is named by the checkout.defaultRemote configuration variable, we'll use that one for the purposes of disambiguation, even if the isn't unique across all remotes. guess=off emits --no-guess.

...
ignore_other_worktrees Flag

git checkout refuses when the wanted branch is already checked out or otherwise in use by another worktree.

...
ignore_skip_worktree_bits Flag

In sparse checkout mode, git checkout -- .

...
inter_hunk_context Value

Show the context between diff hunks, up to the specified of lines, thereby fusing hunks that are close to each other. Added in 2.51.0.

...
l Flag

Create the new branch's reflog; see git-branch(1) for details.

...
merge Flag

When switching branches, if you have local modifications to one or more files that are different between the current branch and the branch to which you are switching, the command refuses to switch branches in order to preserve your modifications in context.

...
no_track Flag

Do not set up "upstream" configuration, even if the branch.autoSetupMerge configuration variable is true.

...
orphan Value

Create a new unborn branch, named , started from and switch to it.

...
ours Flag

When checking out paths from the index, check out stage #2 (ours) or #3 (theirs) for unmerged paths.

...
overlay Flag

In the default overlay mode, git checkout never removes files from the index or the working tree.

...
overwrite_ignore Flag

Silently overwrite ignored files when switching branches.

...
patch Flag

Interactively select hunks in the difference between the (or the index, if unspecified) and the working tree.

...
pathspec_file_nul Flag

Only meaningful with --pathspec-from-file.

...
pathspec_from_file Value

Pathspec is passed in instead of commandline args.

...
progress Flag

Progress status is reported on the standard error stream by default when it is attached to a terminal, unless --quiet is specified.

...
quiet Flag

Quiet, suppress feedback messages.

...
recurse_submodules Flag

Using --recurse-submodules will update the content of all active submodules according to the commit recorded in the superproject.

...
track ValuedFlag

When creating a new branch, set up "upstream" configuration. Value optional: True for the bare flag, or pass one.

...
unified Value

Generate diffs with lines of context. Added in 2.51.0.

...

Clone

Bases: Tool[_R2]

__call__

__call__(
    repository: str | PathLike[str],
    /,
    *args: str | PathLike[str],
    also_filter_submodules: Flag = ...,
    bare: Flag = ...,
    branch: Value = ...,
    bundle_uri: Value = ...,
    config: Value = ...,
    depth: Value = ...,
    dissociate: Flag = ...,
    filter: Value = ...,
    jobs: Value = ...,
    local: Flag = ...,
    mirror: Flag = ...,
    no_checkout: Flag = ...,
    no_hardlinks: Flag = ...,
    no_reject_shallow: Flag = ...,
    origin: Value = ...,
    progress: Flag = ...,
    quiet: Flag = ...,
    recurse_submodules: ValuedFlag = ...,
    ref_format: Value = ...,
    reference: Value = ...,
    remote_submodules: Flag = ...,
    revision: Value = ...,
    separate_git_dir: Value = ...,
    server_option: Value = ...,
    shallow_exclude: Value = ...,
    shallow_since: Value = ...,
    shallow_submodules: Flag = ...,
    shared: Flag = ...,
    single_branch: Flag = ...,
    sparse: Flag = ...,
    tags: Flag = ...,
    template: Value = ...,
    upload_pack: Value = ...,
    verbose: Flag = ...,
    **flags: Any,
) -> _R2

Clone a repository into a new directory

Parameters:

Name Type Description Default
also_filter_submodules Flag

Also apply the partial clone filter to any submodules in the repository.

...
bare Flag

Make a bare Git repository.

...
branch Value

Point the newly created HEAD to branch instead of the branch pointed to by the cloned repository's HEAD.

...
bundle_uri Value

Before fetching from the remote, fetch a bundle from the given and unbundle the data into the local repository.

...
config Value

Set a configuration variable in the newly-created repository; this takes effect immediately after the repository is initialized, but before the remote history is fetched or any files checked out.

...
depth Value

Create a shallow clone with a history truncated to the specified number of commits.

...
dissociate Flag

Borrow the objects from reference repositories specified with the --reference options only to reduce network transfer, and stop borrowing from them after a clone is made by making necessary local copies of borrowed objects.

...
filter Value

Use the partial clone feature and request that the server sends a subset of reachable objects according to a given object filter.

...
jobs Value

The number of submodules fetched at the same time.

...
local Flag

When the repository to clone from is on a local machine, this flag bypasses the normal "Git aware" transport mechanism and clones the repository by making a copy of HEAD and everything under objects and refs directories.

...
mirror Flag

Set up a mirror of the source repository.

...
no_checkout Flag

Do not checkout HEAD after the clone is complete.

...
no_hardlinks Flag

Force the cloning process from a repository on a local filesystem to copy the files under the .git/objects directory instead of using hardlinks.

...
no_reject_shallow Flag

Fail if the source repository is a shallow repository. Added in 2.54.0.

...
origin Value

Instead of using the remote name origin to keep track of the upstream repository, use .

...
progress Flag

Report progress status on the standard error stream by default when attached to a terminal, unless --quiet is specified.

...
quiet Flag

Operate quietly.

...
recurse_submodules ValuedFlag

After the clone is created, initialize and clone submodules within based on the provided . Value optional: True for the bare flag, or pass one.

...
ref_format Value

Specify the given ref storage format for the repository.

...
reference Value

If the reference is on the local machine, automatically setup .git/objects/info/alternates to obtain objects from the reference .

...
remote_submodules Flag

All submodules which are cloned will use the status of the submodule's remote-tracking branch to update the submodule, rather than the superproject's recorded SHA-1. Added in 2.52.0.

...
revision Value

Create a new repository, and fetch the history leading to the given revision (and nothing else), without making any remote-tracking branch, and without making any local branch, and detach HEAD to .

...
separate_git_dir Value

Instead of placing the cloned repository where it is supposed to be, place the cloned repository at the specified directory, then make a filesystem-agnostic Git symbolic link to there.

...
server_option Value

Transmit the given string to the server when communicating using protocol version 2.

...
shallow_exclude Value

Create a shallow clone with a history, excluding commits reachable from a specified remote branch or tag. May be repeated: a list emits the flag once per item.

...
shallow_since Value

Create a shallow clone with a history after the specified time.

...
shallow_submodules Flag

All submodules which are cloned will be shallow with a depth of 1. Added in 2.52.0.

...
shared Flag

When the repository to clone is on the local machine, instead of using hard links, automatically setup .git/objects/info/alternates to share the objects with the source repository.

...
single_branch Flag

Clone only the history leading to the tip of a single branch, either specified by the --branch option or the primary branch remote's HEAD points at. Added in 2.52.0.

...
sparse Flag

Employ a sparse-checkout, with only files in the toplevel directory initially being present.

...
tags Flag

Control whether or not tags will be cloned. Added in 2.52.0.

...
template Value

Specify the directory from which templates will be used; (See the "TEMPLATE DIRECTORY" section of git-init(1).).

...
upload_pack Value

Specify a non-default path for the command run on the other end when the repository to clone from is accessed via ssh.

...
verbose Flag

Run verbosely.

...

Commit

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    all: Flag = ...,
    allow_empty: Flag = ...,
    allow_empty_message: Flag = ...,
    amend: Flag = ...,
    author: Value = ...,
    branch: Flag = ...,
    cleanup: Value = ...,
    date: Value = ...,
    dry_run: Flag = ...,
    edit: Flag = ...,
    file: Value = ...,
    fixup: Value = ...,
    gpg_sign: ValuedFlag = ...,
    include: Flag = ...,
    inter_hunk_context: Value = ...,
    long: Flag = ...,
    message: Value = ...,
    no_post_rewrite: Flag = ...,
    null: Flag = ...,
    only: Flag = ...,
    patch: Flag = ...,
    pathspec_file_nul: Flag = ...,
    pathspec_from_file: Value = ...,
    porcelain: Flag = ...,
    quiet: Flag = ...,
    reedit_message: Value = ...,
    reset_author: Flag = ...,
    reuse_message: Value = ...,
    short: Flag = ...,
    signoff: Flag = ...,
    squash: Value = ...,
    status: Flag = ...,
    template: Value = ...,
    trailer: Value = ...,
    unified: Value = ...,
    untracked_files: ValuedFlag = ...,
    verbose: Flag = ...,
    verify: Flag = ...,
    **flags: Any,
) -> _R2

Record changes to the repository

Parameters:

Name Type Description Default
all Flag

Automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.

...
allow_empty Flag

Usually recording a commit that has the exact same tree as its sole parent commit is a mistake, and the command prevents you from making such a commit.

...
allow_empty_message Flag

Create a commit with an empty commit message without using plumbing commands like git-commit-tree(1).

...
amend Flag

Replace the tip of the current branch by creating a new commit.

...
author Value

Override the commit author.

...
branch Flag

Show the branch and tracking info even in short-format.

...
cleanup Value

Determine how the supplied commit message should be cleaned up before committing.

...
date Value

Override the author date used in the commit.

...
dry_run Flag

Do not create a commit, but show a list of paths that are to be committed, paths with local changes that will be left uncommitted and paths that are untracked.

...
edit Flag

Let the user further edit the message taken from with -F , command line with -m , and from with -C . edit=off emits --no-edit.

...
file Value

Take the commit message from .

...
fixup Value

Create a new commit which "fixes up" when applied with git rebase --autosquash. May be repeated: a list emits the flag once per item.

...
gpg_sign ValuedFlag

GPG-sign commits. Value optional: True for the bare flag, or pass one.

...
include Flag

Before making a commit out of staged contents so far, stage the contents of paths given on the command line as well.

...
inter_hunk_context Value

Show the context between diff hunks, up to the specified of lines, thereby fusing hunks that are close to each other. Added in 2.51.0.

...
long Flag

When doing a dry-run, give the output in the long-format.

...
message Value

Use as the commit message.

...
no_post_rewrite Flag

Bypass the post-rewrite hook.

...
null Flag

When showing short or porcelain git-status(1) output, print the filename verbatim and terminate the entries with NUL, instead of LF.

...
only Flag

Make a commit by taking the updated working tree contents of the paths specified on the command line, disregarding any contents that have been staged for other paths.

...
patch Flag

Use the interactive patch selection interface to choose which changes to commit.

...
pathspec_file_nul Flag

Only meaningful with --pathspec-from-file.

...
pathspec_from_file Value

Pass pathspec in instead of commandline args.

...
porcelain Flag

When doing a dry-run, give the output in a porcelain-ready format.

...
quiet Flag

Suppress commit summary message.

...
reedit_message Value

Like -C, but with -c the editor is invoked, so that the user can further edit the commit message.

...
reset_author Flag

When used with -C/-c/--amend options, or when committing after a conflicting cherry-pick, declare that the authorship of the resulting commit now belongs to the committer.

...
reuse_message Value

Take an existing object, and reuse the log message and the authorship information (including the timestamp) when creating the commit.

...
short Flag

When doing a dry-run, give the output in the short-format.

...
signoff Flag

Add a Signed-off-by trailer by the committer at the end of the commit log message.

...
squash Value

Construct a commit message for use with git rebase --autosquash. May be repeated: a list emits the flag once per item.

...
status Flag

Include the output of git-status(1) in the commit message template when using an editor to prepare the commit message. status=off emits --no-status.

...
template Value

When editing the commit message, start the editor with the contents in . May be repeated: a list emits the flag once per item.

...
trailer Value

Specify a (, ) pair that should be applied as a trailer. May be repeated: a list emits the flag once per item.

...
unified Value

Generate diffs with lines of context. Added in 2.51.0.

...
untracked_files ValuedFlag

Show untracked files. Value optional: True for the bare flag, or pass one.

...
verbose Flag

Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template to help the user describe the commit by reminding what changes the commit has.

...
verify Flag

Bypass the pre-commit and commit-msg hooks.

...

Describe

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    abbrev: Value = ...,
    all: Flag = ...,
    always: Flag = ...,
    candidates: Value = ...,
    contains: Flag = ...,
    debug: Flag = ...,
    dirty: ValuedFlag = ...,
    exact_match: Flag = ...,
    exclude: Value = ...,
    first_parent: Flag = ...,
    long: Flag = ...,
    match: Value = ...,
    tags: Flag = ...,
    **flags: Any,
) -> _R2

Give an object a human readable name based on an available ref

Parameters:

Name Type Description Default
abbrev Value

Instead of using the default number of hexadecimal digits (which will vary according to the number of objects in the repository with a default of 7) of the abbreviated object name, use digits, or as many digits as needed to form a unique object name.

...
all Flag

Instead of using only the annotated tags, use any ref found in refs/ namespace.

...
always Flag

Show uniquely abbreviated commit object as fallback.

...
candidates Value

Instead of considering only the 10 most recent tags as candidates to describe the input commit-ish consider up to candidates.

...
contains Flag

Instead of finding the tag that predates the commit, find the tag that comes after the commit, and thus contains it.

...
debug Flag

Verbosely display information about the searching strategy being employed to standard error.

...
dirty ValuedFlag

Describe the state of the working tree. Value optional: True for the bare flag, or pass one.

...
exact_match Flag

Only output exact matches (a tag directly references the supplied commit).

...
exclude Value

Do not consider tags matching the given glob(7) pattern, excluding the "refs/tags/" prefix.

...
first_parent Flag

Follow only the first parent commit upon seeing a merge commit.

...
long Flag

Always output the long format (the tag, the number of commits and the abbreviated commit name) even when it matches a tag.

...
match Value

Only consider tags matching the given glob(7) pattern, excluding the "refs/tags/" prefix.

...
tags Flag

Instead of using only the annotated tags, use any tag found in refs/tags namespace.

...

Diff

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    G: Flag = ...,
    O: Flag = ...,
    R: Flag = ...,
    S: Flag = ...,
    abbrev: ValuedFlag = ...,
    anchored: Value = ...,
    base: Flag = ...,
    binary: Flag = ...,
    break_rewrites: ValuedFlag = ...,
    check: Flag = ...,
    color: ValuedFlag = ...,
    color_moved: ValuedFlag = ...,
    color_moved_ws: Value = ...,
    color_words: ValuedFlag = ...,
    compact_summary: Flag = ...,
    cumulative: Flag = ...,
    default_prefix: Flag = ...,
    diff_algorithm: Flag = ...,
    diff_filter: Value = ...,
    dirstat: ValuedFlag = ...,
    dirstat_by_file: ValuedFlag = ...,
    dst_prefix: Value = ...,
    exit_code: Flag = ...,
    ext_diff: Flag = ...,
    find_copies: ValuedFlag = ...,
    find_copies_harder: Flag = ...,
    find_object: Value = ...,
    find_renames: ValuedFlag = ...,
    full_index: Flag = ...,
    function_context: Flag = ...,
    histogram: Flag = ...,
    ignore_all_space: Flag = ...,
    ignore_blank_lines: Flag = ...,
    ignore_cr_at_eol: Flag = ...,
    ignore_matching_lines: Value = ...,
    ignore_space_at_eol: Flag = ...,
    ignore_space_change: Flag = ...,
    ignore_submodules: ValuedFlag = ...,
    indent_heuristic: Flag = ...,
    inter_hunk_context: Value = ...,
    irreversible_delete: Flag = ...,
    ita_invisible_in_index: Flag = ...,
    l: Flag = ...,
    line_prefix: Value = ...,
    max_depth: Value = ...,
    minimal: Flag = ...,
    name_only: Flag = ...,
    name_status: Flag = ...,
    no_color: Flag = ...,
    no_color_moved: Flag = ...,
    no_color_moved_ws: Flag = ...,
    no_prefix: Flag = ...,
    no_renames: Flag = ...,
    numstat: Flag = ...,
    output: Value = ...,
    output_indicator_new: Value = ...,
    patch: Flag = ...,
    patch_with_raw: Flag = ...,
    patch_with_stat: Flag = ...,
    patience: Flag = ...,
    pickaxe_all: Flag = ...,
    pickaxe_regex: Flag = ...,
    quiet: Flag = ...,
    raw: Flag = ...,
    relative: ValuedFlag = ...,
    rename_empty: Flag = ...,
    shortstat: Flag = ...,
    skip_to: Value = ...,
    src_prefix: Value = ...,
    stat: ValuedFlag = ...,
    submodule: ValuedFlag = ...,
    summary: Flag = ...,
    text: Flag = ...,
    textconv: Flag = ...,
    unified: Value = ...,
    word_diff: ValuedFlag = ...,
    word_diff_regex: Value = ...,
    ws_error_highlight: Value = ...,
    z: Flag = ...,
    **flags: Any,
) -> _R2

Show changes between commits, commit and working tree, etc

Parameters:

Name Type Description Default
G Flag

Look for differences whose patch text contains added/removed lines that match .

...
O Flag

Control the order in which files appear in the output.

...
R Flag

Swap two inputs; that is, show differences from index or on-disk file to tree contents.

...
S Flag

Look for differences that change the number of occurrences of the specified (i.e.

...
abbrev ValuedFlag

Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header lines, show the shortest prefix that is at least hexdigits long that uniquely refers the object. Value optional: True for the bare flag, or pass one.

...
anchored Value

Generate a diff using the "anchored diff" algorithm. May be repeated: a list emits the flag once per item.

...
base Flag

Compare the working tree with • the "base" version (stage #1) when using -1 or --base, • "our branch" (stage #2) when using -2 or --ours, or • "their branch" (stage #3) when using -3 or --theirs.

...
binary Flag

In addition to --full-index, output a binary diff that can be applied with git-apply.

...
break_rewrites ValuedFlag

Break complete rewrite changes into pairs of delete and create. Value optional: True for the bare flag, or pass one.

...
check Flag

Warn if changes introduce conflict markers or whitespace errors.

...
color ValuedFlag

Show colored diff. Value optional: True for the bare flag, or pass one.

...
color_moved ValuedFlag

Moved lines of code are colored differently. Value optional: True for the bare flag, or pass one.

...
color_moved_ws Value

This configures how whitespace is ignored when performing the move detection for --color-moved. May be repeated: a list emits the flag once per item.

...
color_words ValuedFlag

Equivalent to --word-diff=color plus (if a regex was specified) --word-diff-regex=. Value optional: True for the bare flag, or pass one.

...
compact_summary Flag

Output a condensed summary of extended header information such as file creations or deletions ("new" or "gone", optionally +l if it's a symlink) and mode changes (+x or -x for adding or removing executable bit respectively) in diffstat.

...
cumulative Flag

Synonym for --dirstat=cumulative.

...
default_prefix Flag

Use the default source and destination prefixes ("a/" and "b/").

...
diff_algorithm Flag

Choose a diff algorithm.

...
diff_filter Value

Select only files that are Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R), have their type (i.e. May be repeated: a list emits the flag once per item.

...
dirstat ValuedFlag

Output the distribution of relative amount of changes for each sub-directory. Value optional: True for the bare flag, or pass one.

...
dirstat_by_file ValuedFlag

Synonym for --dirstat=files,,. Value optional: True for the bare flag, or pass one.

...
dst_prefix Value

Show the given destination instead of "b/".

...
exit_code Flag

Make the program exit with codes similar to diff(1).

...
ext_diff Flag

Allow an external diff helper to be executed. ext_diff=off emits --no-ext-diff.

...
find_copies ValuedFlag

Detect copies as well as renames. Value optional: True for the bare flag, or pass one.

...
find_copies_harder Flag

For performance reasons, by default, -C option finds copies only if the original file of the copy was modified in the same changeset.

...
find_object Value

Look for differences that change the number of occurrences of the specified object.

...
find_renames ValuedFlag

Detect renames. Value optional: True for the bare flag, or pass one.

...
full_index Flag

Instead of the first handful of characters, show the full pre- and post-image blob object names on the "index" line when generating patch format output.

...
function_context Flag

Show whole function as context lines for each change.

...
histogram Flag

Generate a diff using the "histogram diff" algorithm.

...
ignore_all_space Flag

Ignore whitespace when comparing lines.

...
ignore_blank_lines Flag

Ignore changes whose lines are all blank.

...
ignore_cr_at_eol Flag

Ignore carriage-return at the end of line when doing a comparison.

...
ignore_matching_lines Value

Ignore changes whose all lines match . May be repeated: a list emits the flag once per item.

...
ignore_space_at_eol Flag

Ignore changes in whitespace at EOL.

...
ignore_space_change Flag

Ignore changes in amount of whitespace.

...
ignore_submodules ValuedFlag

Ignore changes to submodules in the diff generation. Value optional: True for the bare flag, or pass one.

...
indent_heuristic Flag

Enable the heuristic that shifts diff hunk boundaries to make patches easier to read. indent_heuristic=off emits --no-indent-heuristic.

...
inter_hunk_context Value

Show the context between diff hunks, up to the specified of lines, thereby fusing hunks that are close to each other.

...
irreversible_delete Flag

Omit the preimage for deletes, i.e. print only the header but not the diff between the preimage and /dev/null.

...
ita_invisible_in_index Flag

By default entries added by git add -N appear as an existing empty file in git diff and a new file in git diff --cached.

...
l Flag

The -M and -C options involve some preliminary steps that can detect subsets of renames/copies cheaply, followed by an exhaustive fallback portion that compares all remaining unpaired destinations to all relevant sources.

...
line_prefix Value

Prepend an additional to every line of output.

...
max_depth Value

For each pathspec given on command line, descend at most levels of directories. Added in 2.52.0.

...
minimal Flag

Spend extra time to make sure the smallest possible diff is produced.

...
name_only Flag

Show only the name of each changed file in the post-image tree.

...
name_status Flag

Show only the name(s) and status of each changed file.

...
no_color Flag

Turn off colored diff.

...
no_color_moved Flag

Turn off move detection.

...
no_color_moved_ws Flag

Do not ignore whitespace when performing move detection.

...
no_prefix Flag

Do not show any source or destination prefix.

...
no_renames Flag

Turn off rename detection, even when the configuration file gives the default to do so.

...
numstat Flag

Similar to --stat, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly.

...
output Value

Output to a specific file instead of stdout.

...
output_indicator_new Value

Specify the character used to indicate new, old or context lines in the generated patch.

...
patch Flag

Generate patch (see the section called "GENERATING PATCH TEXT WITH -P"). patch=off emits --no-patch.

...
patch_with_raw Flag

Synonym for -p --raw.

...
patch_with_stat Flag

Synonym for -p --stat.

...
patience Flag

Generate a diff using the "patience diff" algorithm.

...
pickaxe_all Flag

When -S or -G finds a change, show all the changes in that changeset, not just the files that contain the change in .

...
pickaxe_regex Flag

Treat the given to -S as an extended POSIX regular expression to match.

...
quiet Flag

Disable all output of the program.

...
raw Flag

Generate the diff in raw format.

...
relative ValuedFlag

When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option. Value optional: True for the bare flag, or pass one.

...
rename_empty Flag

Whether to use empty blobs as rename source. Added in 2.52.0.

...
shortstat Flag

Output only the last line of the --stat format containing total number of modified files, as well as number of added and deleted lines.

...
skip_to Value

Discard the files before the named from the output (i.e.

...
src_prefix Value

Show the given source instead of "a/".

...
stat ValuedFlag

Generate a diffstat. Value optional: True for the bare flag, or pass one.

...
submodule ValuedFlag

Specify how differences in submodules are shown. Value optional: True for the bare flag, or pass one.

...
summary Flag

Output a condensed summary of extended header information such as creations, renames and mode changes.

...
text Flag

Treat all files as text.

...
textconv Flag

Allow (or disallow) external text conversion filters to be run when comparing binary files.

...
unified Value

Generate diffs with lines of context.

...
word_diff ValuedFlag

By default, words are delimited by whitespace; see --word-diff-regex below. Value optional: True for the bare flag, or pass one.

...
word_diff_regex Value

Use to decide what a word is, instead of considering runs of non-whitespace to be a word.

...
ws_error_highlight Value

Highlight whitespace errors in the context, old or new lines of the diff.

...
z Flag

When --raw, --numstat, --name-only or --name-status has been given, do not munge pathnames and use NULs as output field terminators.

...

Fetch

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    all: Flag = ...,
    append: Flag = ...,
    atomic: Flag = ...,
    auto_maintenance: Flag = ...,
    deepen: Value = ...,
    depth: Value = ...,
    dry_run: Flag = ...,
    filter: Value = ...,
    force: Flag = ...,
    ipv4: Flag = ...,
    ipv6: Flag = ...,
    jobs: Value = ...,
    keep: Flag = ...,
    multiple: Flag = ...,
    negotiate_only: Flag = ...,
    negotiation_include: Flag = ...,
    negotiation_restrict: Flag = ...,
    negotiation_tip: Flag = ...,
    no_recurse_submodules: Flag = ...,
    porcelain: Flag = ...,
    prefetch: Flag = ...,
    progress: Flag = ...,
    prune: Flag = ...,
    prune_tags: Flag = ...,
    quiet: Flag = ...,
    recurse_submodules: ValuedFlag = ...,
    recurse_submodules_default: Flag = ...,
    refetch: Flag = ...,
    refmap: Value = ...,
    server_option: Value = ...,
    set_upstream: Flag = ...,
    shallow_exclude: Value = ...,
    shallow_since: Value = ...,
    show_forced_updates: Flag = ...,
    stdin: Flag = ...,
    submodule_prefix: Value = ...,
    tags: Flag = ...,
    unshallow: Flag = ...,
    update_head_ok: Flag = ...,
    update_shallow: Flag = ...,
    upload_pack: Value = ...,
    verbose: Flag = ...,
    write_commit_graph: Flag = ...,
    write_fetch_head: Flag = ...,
    **flags: Any,
) -> _R2

Download objects and refs from another repository

Parameters:

Name Type Description Default
all Flag

Fetch all remotes, except for the ones that have the remote..skipFetchAll configuration variable set. Added in 2.52.0.

...
append Flag

Append ref names and object names of fetched refs to the existing contents of .git/FETCH_HEAD.

...
atomic Flag

Use an atomic transaction to update local refs.

...
auto_maintenance Flag

Run git maintenance run --auto at the end to perform automatic repository maintenance if needed. Added in 2.52.0.

...
deepen Value

Similar to --depth, except it specifies the number of commits from the current shallow boundary instead of from the tip of each remote branch history.

...
depth Value

Limit fetching to the specified number of commits from the tip of each remote branch history.

...
dry_run Flag

Show what would be done, without making any changes.

...
filter Value

Use the partial clone feature and request that the server sends a subset of reachable objects according to a given object filter. Added in 2.54.0.

...
force Flag

When git fetch is used with : refspec, it may refuse to update the local branch as discussed in the part below.

...
ipv4 Flag

Use IPv4 addresses only, ignoring IPv6 addresses.

...
ipv6 Flag

Use IPv6 addresses only, ignoring IPv4 addresses.

...
jobs Value

Parallelize all forms of fetching up to jobs at a time.

...
keep Flag

Keep downloaded pack.

...
multiple Flag

Allow several and arguments to be specified.

...
negotiate_only Flag

Do not fetch anything from the server, and instead print the ancestors of the provided --negotiation-restrict= arguments, which we have in common with the server.

...
negotiation_include Flag

Ensure that the commits at the given tips are always sent as "have" lines during fetch negotiation, regardless of what the negotiation algorithm selects. Added in 2.55.0.

...
negotiation_restrict Flag

By default, Git will report, to the server, commits reachable from all local refs to find common commits in an attempt to reduce the size of the to-be-received packfile. Added in 2.55.0.

...
negotiation_tip Flag

By default, Git will report, to the server, commits reachable from all local refs to find common commits in an attempt to reduce the size of the to-be-received packfile. Gone since 2.55.0.

...
no_recurse_submodules Flag

Disable recursive fetching of submodules (this has the same effect as using the --recurse-submodules=no option).

...
porcelain Flag

Print the output to standard output in an easy-to-parse format for scripts.

...
prefetch Flag

Modify the configured refspec to place all refs into the refs/prefetch/ namespace.

...
progress Flag

Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified.

...
prune Flag

Before fetching, remove any remote-tracking references that no longer exist on the remote.

...
prune_tags Flag

Before fetching, remove any local tags that no longer exist on the remote if --prune is enabled.

...
quiet Flag

Pass --quiet to git-fetch-pack and silence any other internally used git commands.

...
recurse_submodules ValuedFlag

Control if and under what conditions new commits of submodules should be fetched too. Value optional: True for the bare flag, or pass one.

...
recurse_submodules_default Flag

This option is used internally to temporarily provide a non-negative default value for the --recurse-submodules option.

...
refetch Flag

Instead of negotiating with the server to avoid transferring commits and associated objects that are already present locally, this option fetches all objects as a fresh clone would.

...
refmap Value

When fetching refs listed on the command line, use the specified refspec (can be given more than once) to map the refs to remote-tracking branches, instead of the values of remote..fetch configuration variables for the remote repository. May be repeated: a list emits the flag once per item.

...
server_option Value

Transmit the given string to the server when communicating using protocol version 2.

...
set_upstream Flag

If the remote is fetched successfully, add upstream (tracking) reference, used by argument-less git-pull(1) and other commands.

...
shallow_exclude Value

Deepen or shorten the history of a shallow repository to exclude commits reachable from a specified remote branch or tag. May be repeated: a list emits the flag once per item.

...
shallow_since Value

Deepen or shorten the history of a shallow repository to include all reachable commits after .

...
show_forced_updates Flag

By default, git checks if a branch is force-updated during fetch. show_forced_updates=off emits --no-show-forced-updates.

...
stdin Flag

Read refspecs, one per line, from stdin in addition to those provided as arguments.

...
submodule_prefix Value

Prepend to paths printed in informative messages such as "Fetching submodule foo".

...
tags Flag

Fetch all tags from the remote (i.e., fetch remote tags refs/tags/* into local tags with the same name), in addition to whatever else would otherwise be fetched. tags=off emits --no-tags.

...
unshallow Flag

If the source repository is complete, convert a shallow repository to a complete one, removing all the limitations imposed by shallow repositories.

...
update_head_ok Flag

By default git fetch refuses to update the head which corresponds to the current branch.

...
update_shallow Flag

By default when fetching from a shallow repository, git fetch refuses refs that require updating .git/shallow.

...
upload_pack Value

When given, and the repository to fetch from is handled by git fetch-pack, --exec= is passed to the command to specify non-default path for the command run on the other end.

...
verbose Flag

Be verbose.

...
write_commit_graph Flag

Write a commit-graph after fetching. Added in 2.52.0.

...
write_fetch_head Flag

Write the list of remote refs fetched in the FETCH_HEAD file directly under $GIT_DIR. Added in 2.52.0.

...

Init

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    bare: Flag = ...,
    initial_branch: Value = ...,
    object_format: Value = ...,
    quiet: Flag = ...,
    ref_format: Value = ...,
    separate_git_dir: Value = ...,
    shared: ValuedFlag = ...,
    template: Value = ...,
    **flags: Any,
) -> _R2

Create an empty Git repository or reinitialize an existing one

Parameters:

Name Type Description Default
bare Flag

Create a bare repository.

...
initial_branch Value

Use for the initial branch in the newly created repository.

...
object_format Value

Specify the given object (hash algorithm) for the repository.

...
quiet Flag

Only print error and warning messages; all other output will be suppressed.

...
ref_format Value

Specify the given ref storage for the repository.

...
separate_git_dir Value

Instead of initializing the repository as a directory to either $GIT_DIR or ./.git/, create a text file there containing the path to the actual repository.

...
shared ValuedFlag

Specify that the Git repository is to be shared amongst several users. Value optional: True for the bare flag, or pass one.

...
template Value

Specify the directory from which templates will be used.

...

Log

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    G: Flag = ...,
    L: Flag = ...,
    O: Flag = ...,
    R: Flag = ...,
    S: Flag = ...,
    abbrev: ValuedFlag = ...,
    abbrev_commit: Flag = ...,
    all: Flag = ...,
    all_match: Flag = ...,
    alternate_refs: Flag = ...,
    ancestry_path: ValuedFlag = ...,
    anchored: Value = ...,
    author: Value = ...,
    author_date_order: Flag = ...,
    basic_regexp: Flag = ...,
    binary: Flag = ...,
    bisect: Flag = ...,
    boundary: Flag = ...,
    branches: ValuedFlag = ...,
    break_rewrites: ValuedFlag = ...,
    c: Flag = ...,
    cc: Flag = ...,
    check: Flag = ...,
    cherry: Flag = ...,
    cherry_mark: Flag = ...,
    cherry_pick: Flag = ...,
    children: Flag = ...,
    clear_decorations: Flag = ...,
    color: ValuedFlag = ...,
    color_moved: ValuedFlag = ...,
    color_moved_ws: Value = ...,
    color_words: ValuedFlag = ...,
    combined_all_paths: Flag = ...,
    compact_summary: Flag = ...,
    cumulative: Flag = ...,
    date: Value = ...,
    date_order: Flag = ...,
    dd: Flag = ...,
    decorate_refs: Value = ...,
    default_prefix: Flag = ...,
    dense: Flag = ...,
    diff_algorithm: Flag = ...,
    diff_filter: Value = ...,
    diff_merges: Value = ...,
    dirstat: ValuedFlag = ...,
    dirstat_by_file: ValuedFlag = ...,
    do_walk: Flag = ...,
    dst_prefix: Value = ...,
    encoding: Value = ...,
    exclude: Value = ...,
    exclude_first_parent_only: Flag = ...,
    exclude_hidden: Flag = ...,
    expand_tabs: Value = ...,
    ext_diff: Flag = ...,
    extended_regexp: Flag = ...,
    find_copies: ValuedFlag = ...,
    find_copies_harder: Flag = ...,
    find_object: Value = ...,
    find_renames: ValuedFlag = ...,
    first_parent: Flag = ...,
    fixed_strings: Flag = ...,
    follow: Flag = ...,
    full_diff: Flag = ...,
    full_history: Flag = ...,
    full_index: Flag = ...,
    function_context: Flag = ...,
    glob: Value = ...,
    graph: Flag = ...,
    graph_lane_limit: Value = ...,
    grep: Value = ...,
    grep_reflog: Value = ...,
    histogram: Flag = ...,
    ignore_all_space: Flag = ...,
    ignore_blank_lines: Flag = ...,
    ignore_cr_at_eol: Flag = ...,
    ignore_matching_lines: Value = ...,
    ignore_missing: Flag = ...,
    ignore_space_at_eol: Flag = ...,
    ignore_space_change: Flag = ...,
    ignore_submodules: ValuedFlag = ...,
    indent_heuristic: Flag = ...,
    inter_hunk_context: Value = ...,
    invert_grep: Flag = ...,
    irreversible_delete: Flag = ...,
    ita_invisible_in_index: Flag = ...,
    l: Flag = ...,
    left_only: Flag = ...,
    left_right: Flag = ...,
    line_prefix: Value = ...,
    log_size: Flag = ...,
    m: Flag = ...,
    mailmap: Flag = ...,
    max_count_oldest: Value = ...,
    max_depth: Value = ...,
    maximal_only: Flag = ...,
    merge: Flag = ...,
    merges: Flag = ...,
    min_parents: Value = ...,
    minimal: Flag = ...,
    name_only: Flag = ...,
    name_status: Flag = ...,
    no_color: Flag = ...,
    no_color_moved: Flag = ...,
    no_color_moved_ws: Flag = ...,
    no_decorate: ValuedFlag = ...,
    no_diff_merges: Flag = ...,
    no_notes: Flag = ...,
    no_prefix: Flag = ...,
    no_renames: Flag = ...,
    no_walk: ValuedFlag = ...,
    not_: Flag = ...,
    notes: ValuedFlag = ...,
    numstat: Flag = ...,
    oneline: Flag = ...,
    output: Value = ...,
    output_indicator_new: Value = ...,
    parents: Flag = ...,
    patch: Flag = ...,
    patch_with_raw: Flag = ...,
    patch_with_stat: Flag = ...,
    patience: Flag = ...,
    perl_regexp: Flag = ...,
    pickaxe_all: Flag = ...,
    pickaxe_regex: Flag = ...,
    raw: Flag = ...,
    reflog: Flag = ...,
    regexp_ignore_case: Flag = ...,
    relative: ValuedFlag = ...,
    relative_date: Flag = ...,
    remerge_diff: Flag = ...,
    remotes: ValuedFlag = ...,
    remove_empty: Flag = ...,
    rename_empty: Flag = ...,
    reverse: Flag = ...,
    shortstat: Flag = ...,
    show_linear_break: ValuedFlag = ...,
    show_notes: ValuedFlag = ...,
    show_notes_by_default: Flag = ...,
    show_pulls: Flag = ...,
    show_signature: Flag = ...,
    simplify_by_decoration: Flag = ...,
    simplify_merges: Flag = ...,
    since: Value = ...,
    since_as_filter: Value = ...,
    single_worktree: Flag = ...,
    skip: Value = ...,
    skip_to: Value = ...,
    source: Flag = ...,
    sparse: Flag = ...,
    src_prefix: Value = ...,
    stat: ValuedFlag = ...,
    stdin: Flag = ...,
    submodule: ValuedFlag = ...,
    summary: Flag = ...,
    t: Flag = ...,
    tags: ValuedFlag = ...,
    text: Flag = ...,
    textconv: Flag = ...,
    topo_order: Flag = ...,
    unified: Value = ...,
    until: Value = ...,
    walk_reflogs: Flag = ...,
    word_diff: ValuedFlag = ...,
    word_diff_regex: Value = ...,
    ws_error_highlight: Value = ...,
    z: Flag = ...,
    **flags: Any,
) -> _R2

Show commit logs

Parameters:

Name Type Description Default
G Flag

Look for differences whose patch text contains added/removed lines that match .

...
L Flag

Trace the evolution of the line range given by ,, or by the function name regex , within the .

...
O Flag

Control the order in which files appear in the output.

...
R Flag

Swap two inputs; that is, show differences from index or on-disk file to tree contents.

...
S Flag

Look for differences that change the number of occurrences of the specified (i.e.

...
abbrev ValuedFlag

Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header lines, show the shortest prefix that is at least hexdigits long that uniquely refers the object. Value optional: True for the bare flag, or pass one.

...
abbrev_commit Flag

Instead of showing the full 40-byte hexadecimal commit object name, show a prefix that names the object uniquely. abbrev_commit=off emits --no-abbrev-commit.

...
all Flag

Pretend as if all the refs in refs/, along with HEAD, are listed on the command line as .

...
all_match Flag

Limit the commits output to ones that match all given --grep, instead of ones that match at least one.

...
alternate_refs Flag

Pretend as if all objects mentioned as ref tips of alternate repositories were listed on the command line.

...
ancestry_path ValuedFlag

When given a range of commits to display (e.g. Value optional: True for the bare flag, or pass one.

...
anchored Value

Generate a diff using the "anchored diff" algorithm. May be repeated: a list emits the flag once per item.

...
author Value

Limit the commits output to ones with author/committer header lines that match the regular expression.

...
author_date_order Flag

Show no parents before all of its children are shown, but otherwise show commits in the author timestamp order.

...
basic_regexp Flag

Consider the limiting patterns to be basic regular expressions; this is the default.

...
binary Flag

In addition to --full-index, output a binary diff that can be applied with git-apply.

...
bisect Flag

Pretend as if the bad bisection ref refs/bisect/bad was listed and as if it was followed by --not and the good bisection refs refs/bisect/good-* on the command line.

...
boundary Flag

Output excluded boundary commits.

...
branches ValuedFlag

Pretend as if all the refs in refs/heads are listed on the command line as . Value optional: True for the bare flag, or pass one.

...
break_rewrites ValuedFlag

Break complete rewrite changes into pairs of delete and create. Value optional: True for the bare flag, or pass one.

...
c Flag

Produce combined diff output for merge commits.

...
cc Flag

Produce dense combined diff output for merge commits.

...
check Flag

Warn if changes introduce conflict markers or whitespace errors.

...
cherry Flag

A synonym for --right-only --cherry-mark --no-merges; useful to limit the output to the commits on our side and mark those that have been applied to the other side of a forked history with git log --cherry upstream...mybranch, similar to git cherry upstream mybranch.

...
cherry_mark Flag

Like --cherry-pick (see below) but mark equivalent commits with = rather than omitting them, and inequivalent ones with +.

...
cherry_pick Flag

Omit any commit that introduces the same change as another commit on the "other side" when the set of commits are limited with symmetric difference.

...
children Flag

Print also the children of the commit (in the form "commit child...").

...
clear_decorations Flag

When specified, this option clears all previous --decorate-refs or --decorate-refs-exclude options and relaxes the default decoration filter to include all references.

...
color ValuedFlag

Show colored diff. Value optional: True for the bare flag, or pass one.

...
color_moved ValuedFlag

Moved lines of code are colored differently. Value optional: True for the bare flag, or pass one.

...
color_moved_ws Value

This configures how whitespace is ignored when performing the move detection for --color-moved. May be repeated: a list emits the flag once per item.

...
color_words ValuedFlag

Equivalent to --word-diff=color plus (if a regex was specified) --word-diff-regex=. Value optional: True for the bare flag, or pass one.

...
combined_all_paths Flag

Cause combined diffs (used for merge commits) to list the name of the file from all parents.

...
compact_summary Flag

Output a condensed summary of extended header information such as file creations or deletions ("new" or "gone", optionally +l if it's a symlink) and mode changes (+x or -x for adding or removing executable bit respectively) in diffstat.

...
cumulative Flag

Synonym for --dirstat=cumulative.

...
date Value

Only takes effect for dates shown in human-readable format, such as when using --pretty.

...
date_order Flag

Show no parents before all of its children are shown, but otherwise show commits in the commit timestamp order.

...
dd Flag

Produce diff with respect to first parent for both merge and regular commits.

...
decorate_refs Value

For each candidate reference, do not use it for decoration if it matches any of the parameters given to --decorate-refs-exclude or if it doesn't match any of the parameters given to --decorate-refs.

...
default_prefix Flag

Use the default source and destination prefixes ("a/" and "b/").

...
dense Flag

Only the selected commits are shown, plus some to have a meaningful history.

...
diff_algorithm Flag

Choose a diff algorithm.

...
diff_filter Value

Select only files that are Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R), have their type (i.e. May be repeated: a list emits the flag once per item.

...
diff_merges Value

Specify diff format to be used for merge commits.

...
dirstat ValuedFlag

Output the distribution of relative amount of changes for each sub-directory. Value optional: True for the bare flag, or pass one.

...
dirstat_by_file ValuedFlag

Synonym for --dirstat=files,,. Value optional: True for the bare flag, or pass one.

...
do_walk Flag

Overrides a previous --no-walk.

...
dst_prefix Value

Show the given destination instead of "b/".

...
encoding Value

Commit objects record the character encoding used for the log message in their encoding header; this option can be used to tell the command to re-code the commit log message in the encoding preferred by the user. May be repeated: a list emits the flag once per item.

...
exclude Value

Do not include refs matching that the next --all, --branches, --tags, --remotes, or --glob would otherwise consider.

...
exclude_first_parent_only Flag

When finding commits to exclude (with a ^), follow only the first parent commit upon seeing a merge commit.

...
exclude_hidden Flag

Do not include refs that would be hidden by git-fetch, git-receive-pack or git-upload-pack by consulting the appropriate fetch.hideRefs, receive.hideRefs or uploadpack.hideRefs configuration along with transfer.hideRefs (see git-config(1)).

...
expand_tabs Value

Perform a tab expansion (replace each tab with enough spaces to fill to the next display column that is a multiple of ) in the log message before showing it in the output.

...
ext_diff Flag

Allow an external diff helper to be executed. ext_diff=off emits --no-ext-diff.

...
extended_regexp Flag

Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions.

...
find_copies ValuedFlag

Detect copies as well as renames. Value optional: True for the bare flag, or pass one.

...
find_copies_harder Flag

For performance reasons, by default, -C option finds copies only if the original file of the copy was modified in the same changeset.

...
find_object Value

Look for differences that change the number of occurrences of the specified object.

...
find_renames ValuedFlag

If generating diffs, detect and report renames for each commit. Value optional: True for the bare flag, or pass one.

...
first_parent Flag

When finding commits to include, follow only the first parent commit upon seeing a merge commit.

...
fixed_strings Flag

Consider the limiting patterns to be fixed strings (don't interpret pattern as a regular expression).

...
follow Flag

Continue listing the history of a file beyond renames (works only for a single file).

...
full_diff Flag

Without this flag, git log -p .

...
full_history Flag

Same as the default mode, but does not prune some history.

...
full_index Flag

Instead of the first handful of characters, show the full pre- and post-image blob object names on the "index" line when generating patch format output.

...
function_context Flag

Show whole function as context lines for each change.

...
glob Value

Pretend as if all the refs matching shell glob are listed on the command line as .

...
graph Flag

Draw a text-based graphical representation of the commit history on the left hand side of the output.

...
graph_lane_limit Value

When --graph is used, limit the number of graph lanes to be shown. Added in 2.55.0.

...
grep Value

Limit the commits output to ones with a log message that matches the regular expression.

...
grep_reflog Value

Limit the commits output to ones with reflog entries that match the regular expression.

...
histogram Flag

Generate a diff using the "histogram diff" algorithm.

...
ignore_all_space Flag

Ignore whitespace when comparing lines.

...
ignore_blank_lines Flag

Ignore changes whose lines are all blank.

...
ignore_cr_at_eol Flag

Ignore carriage-return at the end of line when doing a comparison.

...
ignore_matching_lines Value

Ignore changes whose all lines match . May be repeated: a list emits the flag once per item.

...
ignore_missing Flag

Upon seeing an invalid object name in the input, pretend as if the bad input was not given.

...
ignore_space_at_eol Flag

Ignore changes in whitespace at EOL.

...
ignore_space_change Flag

Ignore changes in amount of whitespace.

...
ignore_submodules ValuedFlag

Ignore changes to submodules in the diff generation. Value optional: True for the bare flag, or pass one.

...
indent_heuristic Flag

Enable the heuristic that shifts diff hunk boundaries to make patches easier to read. indent_heuristic=off emits --no-indent-heuristic.

...
inter_hunk_context Value

Show the context between diff hunks, up to the specified of lines, thereby fusing hunks that are close to each other.

...
invert_grep Flag

Limit the commits output to ones with a log message that do not match the specified with --grep=.

...
irreversible_delete Flag

Omit the preimage for deletes, i.e. print only the header but not the diff between the preimage and /dev/null.

...
ita_invisible_in_index Flag

By default entries added by git add -N appear as an existing empty file in git diff and a new file in git diff --cached.

...
l Flag

The -M and -C options involve some preliminary steps that can detect subsets of renames/copies cheaply, followed by an exhaustive fallback portion that compares all remaining unpaired destinations to all relevant sources.

...
left_only Flag

List only commits on the respective side of a symmetric difference, i.e. only those which would be marked < resp.

...
left_right Flag

Mark which side of a symmetric difference a commit is reachable from.

...
line_prefix Value

Prepend an additional to every line of output.

...
log_size Flag

Include a line log size in the output for each commit, where is the length of that commit's message in bytes.

...
m Flag

Show diffs for merge commits in the default format.

...
mailmap Flag

Use mailmap file to map author and committer names and email addresses to canonical real names and email addresses. Added in 2.52.0.

...
max_count_oldest Value

Limit the output to the last commits that would be shown. Added in 2.55.0.

...
max_depth Value

For each pathspec given on command line, descend at most levels of directories. Added in 2.52.0.

...
maximal_only Flag

Restrict the output commits to be those that are not reachable from any other commits in the revision range. Added in 2.54.0.

...
merge Flag

Show commits touching conflicted paths in the range HEAD..., where is the first existing pseudoref in MERGE_HEAD, CHERRY_PICK_HEAD, REVERT_HEAD or REBASE_HEAD.

...
merges Flag

Print only merge commits. merges=off emits --no-merges.

...
min_parents Value

Show only commits which have at least (or at most) that many parent commits.

...
minimal Flag

Spend extra time to make sure the smallest possible diff is produced.

...
name_only Flag

Show only the name of each changed file in the post-image tree.

...
name_status Flag

Show only the name(s) and status of each changed file.

...
no_color Flag

Turn off colored diff.

...
no_color_moved Flag

Turn off move detection.

...
no_color_moved_ws Flag

Do not ignore whitespace when performing move detection.

...
no_decorate ValuedFlag

Print out the ref names of any commits that are shown. Value optional: True for the bare flag, or pass one.

...
no_diff_merges Flag

Synonym for --diff-merges=off.

...
no_notes Flag

Do not show notes.

...
no_prefix Flag

Do not show any source or destination prefix.

...
no_renames Flag

Turn off rename detection, even when the configuration file gives the default to do so.

...
no_walk ValuedFlag

Only show the given commits, but do not traverse their ancestors. Value optional: True for the bare flag, or pass one.

...
not_ Flag

Reverses the meaning of the ^ prefix (or lack thereof) for all following revision specifiers, up to the next --not.

...
notes ValuedFlag

Show the notes (see git-notes(1)) that annotate the commit, when showing the commit log message. Value optional: True for the bare flag, or pass one.

...
numstat Flag

Similar to --stat, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly.

...
oneline Flag

This is a shorthand for --pretty=oneline --abbrev-commit used together.

...
output Value

Output to a specific file instead of stdout.

...
output_indicator_new Value

Specify the character used to indicate new, old or context lines in the generated patch.

...
parents Flag

Print also the parents of the commit (in the form "commit parent...").

...
patch Flag

Generate patch (see the section called "GENERATING PATCH TEXT WITH -P"). patch=off emits --no-patch.

...
patch_with_raw Flag

Synonym for -p --raw.

...
patch_with_stat Flag

Synonym for -p --stat.

...
patience Flag

Generate a diff using the "patience diff" algorithm.

...
perl_regexp Flag

Consider the limiting patterns to be Perl-compatible regular expressions.

...
pickaxe_all Flag

When -S or -G finds a change, show all the changes in that changeset, not just the files that contain the change in .

...
pickaxe_regex Flag

Treat the given to -S as an extended POSIX regular expression to match.

...
raw Flag

For each commit, show a summary of changes using the raw diff format.

...
reflog Flag

Pretend as if all objects mentioned by reflogs are listed on the command line as .

...
regexp_ignore_case Flag

Match the regular expression limiting patterns without regard to letter case.

...
relative ValuedFlag

When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option. Value optional: True for the bare flag, or pass one.

...
relative_date Flag

Synonym for --date=relative.

...
remerge_diff Flag

Produce remerge-diff output for merge commits.

...
remotes ValuedFlag

Pretend as if all the refs in refs/remotes are listed on the command line as . Value optional: True for the bare flag, or pass one.

...
remove_empty Flag

Stop when a given path disappears from the tree.

...
rename_empty Flag

Whether to use empty blobs as rename source. Added in 2.52.0.

...
reverse Flag

Output the commits chosen to be shown (see Commit Limiting section above) in reverse order.

...
shortstat Flag

Output only the last line of the --stat format containing total number of modified files, as well as number of added and deleted lines.

...
show_linear_break ValuedFlag

When --graph is not used, all history branches are flattened which can make it hard to see that the two consecutive commits do not belong to a linear branch. Value optional: True for the bare flag, or pass one.

...
show_notes ValuedFlag

These options are deprecated. Value optional: True for the bare flag, or pass one.

...
show_notes_by_default Flag

Show the default notes unless options for displaying specific notes are given.

...
show_pulls Flag

Include all commits from the default mode, but also any merge commits that are not TREESAME to the first parent but are TREESAME to a later parent.

...
show_signature Flag

Check the validity of a signed commit object by passing the signature to gpg --verify and show the output.

...
simplify_by_decoration Flag

Commits that are referred by some branch or tag are selected.

...
simplify_merges Flag

Additional option to --full-history to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge.

...
since Value

Show commits more recent than .

...
since_as_filter Value

Show all commits more recent than .

...
single_worktree Flag

By default, all working trees will be examined by the following options when there are more than one (see git-worktree(1)): --all, --reflog and --indexed-objects.

...
skip Value

Skip commits before starting to show the commit output.

...
skip_to Value

Discard the files before the named from the output (i.e.

...
source Flag

Print out the ref name given on the command line by which each commit was reached.

...
sparse Flag

All commits in the simplified history are shown.

...
src_prefix Value

Show the given source instead of "a/".

...
stat ValuedFlag

Generate a diffstat. Value optional: True for the bare flag, or pass one.

...
stdin Flag

In addition to getting arguments from the command line, read them from standard input as well.

...
submodule ValuedFlag

Specify how differences in submodules are shown. Value optional: True for the bare flag, or pass one.

...
summary Flag

Output a condensed summary of extended header information such as creations, renames and mode changes.

...
t Flag

Show the tree objects in the diff output.

...
tags ValuedFlag

Pretend as if all the refs in refs/tags are listed on the command line as . Value optional: True for the bare flag, or pass one.

...
text Flag

Treat all files as text.

...
textconv Flag

Allow (or disallow) external text conversion filters to be run when comparing binary files.

...
topo_order Flag

Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed.

...
unified Value

Generate diffs with lines of context.

...
until Value

Show commits older than .

...
walk_reflogs Flag

Instead of walking the commit ancestry chain, walk reflog entries from the most recent one to older ones.

...
word_diff ValuedFlag

By default, words are delimited by whitespace; see --word-diff-regex below. Value optional: True for the bare flag, or pass one.

...
word_diff_regex Value

Use to decide what a word is, instead of considering runs of non-whitespace to be a word.

...
ws_error_highlight Value

Highlight whitespace errors in the context, old or new lines of the diff.

...
z Flag

Separate the commits with NULs instead of newlines.

...

Pull

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    allow_unrelated_histories: Flag = ...,
    append: Flag = ...,
    atomic: Flag = ...,
    autostash: Flag = ...,
    cleanup: Value = ...,
    compact_summary: Flag = ...,
    deepen: Value = ...,
    depth: Value = ...,
    dry_run: Flag = ...,
    edit: Flag = ...,
    ff: Flag = ...,
    ff_only: Flag = ...,
    filter: Value = ...,
    force: Flag = ...,
    gpg_sign: ValuedFlag = ...,
    ipv4: Flag = ...,
    ipv6: Flag = ...,
    jobs: Value = ...,
    keep: Flag = ...,
    log: ValuedFlag = ...,
    negotiate_only: Flag = ...,
    negotiation_include: Flag = ...,
    negotiation_restrict: Flag = ...,
    negotiation_tip: Flag = ...,
    no_rebase: Flag = ...,
    porcelain: Flag = ...,
    prefetch: Flag = ...,
    progress: Flag = ...,
    prune: Flag = ...,
    quiet: Flag = ...,
    rebase: ValuedFlag = ...,
    recurse_submodules: ValuedFlag = ...,
    refmap: Value = ...,
    server_option: Value = ...,
    set_upstream: Flag = ...,
    shallow_exclude: Value = ...,
    shallow_since: Value = ...,
    show_forced_updates: Flag = ...,
    signoff: Flag = ...,
    squash: Flag = ...,
    stat: Flag = ...,
    strategy: Value = ...,
    strategy_option: Value = ...,
    summary: Flag = ...,
    tags: Flag = ...,
    unshallow: Flag = ...,
    update_shallow: Flag = ...,
    upload_pack: Value = ...,
    verbose: Flag = ...,
    verify: Flag = ...,
    verify_signatures: Flag = ...,
    **flags: Any,
) -> _R2

Fetch from and integrate with another repository or a local branch

Parameters:

Name Type Description Default
allow_unrelated_histories Flag

By default, git merge command refuses to merge histories that do not share a common ancestor.

...
append Flag

Append ref names and object names of fetched refs to the existing contents of .git/FETCH_HEAD.

...
atomic Flag

Use an atomic transaction to update local refs.

...
autostash Flag

Automatically create a temporary stash entry before the operation begins, record it in the ref MERGE_AUTOSTASH and apply it after the operation ends.

...
cleanup Value

This option determines how the merge message will be cleaned up before committing.

...
compact_summary Flag

Show a compact-summary at the end of the merge. Added in 2.51.0.

...
deepen Value

Similar to --depth, except it specifies the number of commits from the current shallow boundary instead of from the tip of each remote branch history.

...
depth Value

Limit fetching to the specified number of commits from the tip of each remote branch history.

...
dry_run Flag

Show what would be done, without making any changes.

...
edit Flag

Invoke an editor before committing successful mechanical merge to further edit the auto-generated merge message, so that the user can explain and justify the merge.

...
ff Flag

When merging rather than rebasing, specifies how a merge is handled when the merged-in history is already a descendant of the current history.

...
ff_only Flag

Only update to the new history if there is no divergent local history.

...
filter Value

Use the partial clone feature and request that the server sends a subset of reachable objects according to a given object filter. Added in 2.54.0.

...
force Flag

When git fetch is used with : refspec, it may refuse to update the local branch as discussed in the part of the git-fetch(1) documentation.

...
gpg_sign ValuedFlag

GPG-sign the resulting merge commit. Value optional: True for the bare flag, or pass one.

...
ipv4 Flag

Use IPv4 addresses only, ignoring IPv6 addresses.

...
ipv6 Flag

Use IPv6 addresses only, ignoring IPv4 addresses.

...
jobs Value

Parallelize all forms of fetching up to jobs at a time.

...
keep Flag

Keep downloaded pack.

...
log ValuedFlag

In addition to branch names, populate the log message with one-line descriptions from at most actual commits that are being merged. Value optional: True for the bare flag, or pass one.

...
negotiate_only Flag

Do not fetch anything from the server, and instead print the ancestors of the provided --negotiation-restrict= arguments, which we have in common with the server.

...
negotiation_include Flag

Ensure that the commits at the given tips are always sent as "have" lines during fetch negotiation, regardless of what the negotiation algorithm selects. Added in 2.55.0.

...
negotiation_restrict Flag

By default, Git will report, to the server, commits reachable from all local refs to find common commits in an attempt to reduce the size of the to-be-received packfile. Added in 2.55.0.

...
negotiation_tip Flag

By default, Git will report, to the server, commits reachable from all local refs to find common commits in an attempt to reduce the size of the to-be-received packfile. Gone since 2.55.0.

...
no_rebase Flag

This is shorthand for --rebase=false.

...
porcelain Flag

Print the output to standard output in an easy-to-parse format for scripts.

...
prefetch Flag

Modify the configured refspec to place all refs into the refs/prefetch/ namespace.

...
progress Flag

Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified.

...
prune Flag

Before fetching, remove any remote-tracking references that no longer exist on the remote.

...
quiet Flag

This is passed to both underlying git-fetch to squelch reporting of during transfer, and underlying git-merge to squelch output during merging.

...
rebase ValuedFlag

true rebase the current branch on top of the upstream branch after fetching. Value optional: True for the bare flag, or pass one.

...
recurse_submodules ValuedFlag

This option controls if new commits of populated submodules should be fetched, and if the working trees of active submodules should be updated, too (see git-fetch(1), git-config(1) and gitmodules(5)). Value optional: True for the bare flag, or pass one. Added in 2.52.0.

...
refmap Value

When fetching refs listed on the command line, use the specified refspec (can be given more than once) to map the refs to remote-tracking branches, instead of the values of remote..fetch configuration variables for the remote repository. May be repeated: a list emits the flag once per item.

...
server_option Value

Transmit the given string to the server when communicating using protocol version 2.

...
set_upstream Flag

If the remote is fetched successfully, add upstream (tracking) reference, used by argument-less git-pull(1) and other commands.

...
shallow_exclude Value

Deepen or shorten the history of a shallow repository to exclude commits reachable from a specified remote branch or tag. May be repeated: a list emits the flag once per item.

...
shallow_since Value

Deepen or shorten the history of a shallow repository to include all reachable commits after .

...
show_forced_updates Flag

By default, git checks if a branch is force-updated during fetch. show_forced_updates=off emits --no-show-forced-updates.

...
signoff Flag

Add a Signed-off-by trailer by the committer at the end of the commit log message.

...
squash Flag

Produce the working tree and index state as if a real merge happened (except for the merge information), but do not actually make a commit, move the HEAD, or record $GIT_DIR/MERGE_HEAD (to cause the next git commit command to create a merge commit).

...
stat Flag

Show a diffstat at the end of the merge.

...
strategy Value

Use the given merge strategy; can be supplied more than once to specify them in the order they should be tried.

...
strategy_option Value

Pass merge strategy specific option through to the merge strategy.

...
summary Flag

Synonyms to --stat and --no-stat; these are deprecated and will be removed in the future.

...
tags Flag

Fetch all tags from the remote (i.e., fetch remote tags refs/tags/* into local tags with the same name), in addition to whatever else would otherwise be fetched. tags=off emits --no-tags.

...
unshallow Flag

If the source repository is complete, convert a shallow repository to a complete one, removing all the limitations imposed by shallow repositories.

...
update_shallow Flag

By default when fetching from a shallow repository, git fetch refuses refs that require updating .git/shallow.

...
upload_pack Value

When given, and the repository to fetch from is handled by git fetch-pack, --exec= is passed to the command to specify non-default path for the command run on the other end.

...
verbose Flag

Pass --verbose to git-fetch and git-merge.

...
verify Flag

By default, the pre-merge and commit-msg hooks are run. Added in 2.52.0.

...
verify_signatures Flag

Verify that the tip commit of the side branch being merged is signed with a valid key, i.e. a key that has a valid uid: in the default trust model, this means the signing key has been signed by a trusted key.

...

Push

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    all: Flag = ...,
    atomic: Flag = ...,
    delete: Flag = ...,
    dry_run: Flag = ...,
    follow_tags: Flag = ...,
    force: Flag = ...,
    force_if_includes: Flag = ...,
    force_with_lease: Value = ...,
    ipv4: Flag = ...,
    ipv6: Flag = ...,
    mirror: Flag = ...,
    no_recurse_submodules: Flag = ...,
    porcelain: Flag = ...,
    progress: Flag = ...,
    prune: Flag = ...,
    push_option: Value = ...,
    quiet: Flag = ...,
    receive_pack: Value = ...,
    repo: Value = ...,
    set_upstream: Flag = ...,
    signed: Flag = ...,
    tags: Flag = ...,
    thin: Flag = ...,
    verbose: Flag = ...,
    verify: Flag = ...,
    **flags: Any,
) -> _R2

Update remote refs along with associated objects

Parameters:

Name Type Description Default
all Flag

Push all branches (i.e.

...
atomic Flag

Use an atomic transaction on the remote side if available. Added in 2.52.0.

...
delete Flag

All listed refs are deleted from the remote repository.

...
dry_run Flag

Do everything except actually send the updates.

...
follow_tags Flag

Push all the refs that would be pushed without this option, and also push annotated tags in refs/tags that are missing from the remote but are pointing at commit-ish that are reachable from the refs being pushed.

...
force Flag

Usually, git push will refuse to update a branch that is not an ancestor of the commit being pushed.

...
force_if_includes Flag

Force an update only if the tip of the remote-tracking ref has been integrated locally. Added in 2.52.0.

...
force_with_lease Value

Usually, git push refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it.

...
ipv4 Flag

Use IPv4 addresses only, ignoring IPv6 addresses.

...
ipv6 Flag

Use IPv6 addresses only, ignoring IPv4 addresses.

...
mirror Flag

Instead of naming each ref to push, specifies that all refs under refs/ (which includes but is not limited to refs/heads/, refs/remotes/, and refs/tags/) be mirrored to the remote repository.

...
no_recurse_submodules Flag

May be used to make sure all submodule commits used by the revisions to be pushed are available on a remote-tracking branch.

...
porcelain Flag

Produce machine-readable output.

...
progress Flag

Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified.

...
prune Flag

Remove remote branches that don't have a local counterpart.

...
push_option Value

Transmit the given string to the server, which passes them to the pre-receive as well as the post-receive hook.

...
quiet Flag

Suppress all output, including the listing of updated refs, unless an error occurs.

...
receive_pack Value

Path to the git-receive-pack program on the remote end.

...
repo Value

This option is equivalent to the argument.

...
set_upstream Flag

For every branch that is up to date or successfully pushed, add upstream (tracking) reference, used by argument-less git-pull(1) and other commands.

...
signed Flag

GPG-sign the push request to update refs on the receiving side, to allow it to be checked by the hooks and/or be logged. Added in 2.52.0.

...
tags Flag

All refs under refs/tags are pushed, in addition to refspecs explicitly listed on the command line.

...
thin Flag

These options are passed to git-send-pack(1). Added in 2.52.0.

...
verbose Flag

Run verbosely.

...
verify Flag

Toggle the pre-push hook (see githooks(5)). Added in 2.52.0.

...

Restore

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    conflict: Value = ...,
    ignore_skip_worktree_bits: Flag = ...,
    ignore_unmerged: Flag = ...,
    inter_hunk_context: Value = ...,
    merge: Flag = ...,
    ours: Flag = ...,
    overlay: Flag = ...,
    patch: Flag = ...,
    pathspec_file_nul: Flag = ...,
    pathspec_from_file: Value = ...,
    progress: Flag = ...,
    quiet: Flag = ...,
    recurse_submodules: Flag = ...,
    source: Value = ...,
    unified: Value = ...,
    worktree: Flag = ...,
    **flags: Any,
) -> _R2

Restore working tree files

Parameters:

Name Type Description Default
conflict Value

The same as --merge option above, but changes the way the conflicting hunks are presented, overriding the merge.conflictStyle configuration variable.

...
ignore_skip_worktree_bits Flag

In sparse checkout mode, the default is to only update entries matched by and sparse patterns in $GIT_DIR/info/sparse-checkout.

...
ignore_unmerged Flag

When restoring files on the working tree from the index, do not abort the operation if there are unmerged entries and neither --ours, --theirs, --merge or --conflict is specified.

...
inter_hunk_context Value

Show the context between diff hunks, up to the specified of lines, thereby fusing hunks that are close to each other. Added in 2.51.0.

...
merge Flag

When restoring files on the working tree from the index, recreate the conflicted merge in the unmerged paths.

...
ours Flag

When restoring files in the working tree from the index, use stage #2 (ours) or #3 (theirs) for unmerged paths.

...
overlay Flag

In overlay mode, never remove files when restoring.

...
patch Flag

Interactively select hunks in the difference between the restore source and the restore location.

...
pathspec_file_nul Flag

Only meaningful with --pathspec-from-file.

...
pathspec_from_file Value

Pathspec is passed in instead of commandline args.

...
progress Flag

Progress status is reported on the standard error stream by default when it is attached to a terminal, unless --quiet is specified.

...
quiet Flag

Quiet, suppress feedback messages.

...
recurse_submodules Flag

If names an active submodule and the restore location includes the working tree, the submodule will only be updated if this option is given, in which case its working tree will be restored to the commit recorded in the superproject, and any local modifications overwritten.

...
source Value

Restore the working tree files with the content from the given tree.

...
unified Value

Generate diffs with lines of context. Added in 2.51.0.

...
worktree Flag

Specify the restore location.

...

RevParse

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    abbrev_ref: ValuedFlag = ...,
    absolute_git_dir: Flag = ...,
    branches: ValuedFlag = ...,
    disambiguate: Value = ...,
    exclude: Value = ...,
    exclude_hidden: Flag = ...,
    git_common_dir: Flag = ...,
    git_dir: Flag = ...,
    git_path: Value = ...,
    glob: Value = ...,
    is_bare_repository: Flag = ...,
    is_inside_git_dir: Flag = ...,
    is_inside_work_tree: Flag = ...,
    is_shallow_repository: Flag = ...,
    no_revs: Flag = ...,
    not_: Flag = ...,
    output_object_format: Flag = ...,
    parseopt: Flag = ...,
    path_format: Flag = ...,
    prefix: Value = ...,
    quiet: Flag = ...,
    resolve_git_dir: Value = ...,
    shared_index_path: Flag = ...,
    short: ValuedFlag = ...,
    show_cdup: Flag = ...,
    show_object_format: ValuedFlag = ...,
    show_prefix: Flag = ...,
    show_ref_format: Flag = ...,
    show_superproject_working_tree: Flag = ...,
    show_toplevel: Flag = ...,
    sq: Flag = ...,
    sq_quote: Flag = ...,
    stop_at_non_option: Flag = ...,
    stuck_long: Flag = ...,
    symbolic: Flag = ...,
    symbolic_full_name: Flag = ...,
    until: Value = ...,
    verify: Flag = ...,
    **flags: Any,
) -> _R2

Pick out and massage parameters

Parameters:

Name Type Description Default
abbrev_ref ValuedFlag

A non-ambiguous short name of the objects name. Value optional: True for the bare flag, or pass one.

...
absolute_git_dir Flag

Like --git-dir, but its output is always the canonicalized absolute path.

...
branches ValuedFlag

Show all branches, tags, or remote-tracking branches, respectively (i.e., refs found in refs/heads, refs/tags, or refs/remotes, respectively). Value optional: True for the bare flag, or pass one.

...
disambiguate Value

Show every object whose name begins with the given prefix.

...
exclude Value

Do not include refs matching that the next --all, --branches, --tags, --remotes, or --glob would otherwise consider.

...
exclude_hidden Flag

Do not include refs that would be hidden by git-fetch, git-receive-pack or git-upload-pack by consulting the appropriate fetch.hideRefs, receive.hideRefs or uploadpack.hideRefs configuration along with transfer.hideRefs (see git-config(1)).

...
git_common_dir Flag

Show $GIT_COMMON_DIR if defined, else $GIT_DIR.

...
git_dir Flag

Show $GIT_DIR if defined.

...
git_path Value

Resolve "$GIT_DIR/" and takes other path relocation variables such as $GIT_OBJECT_DIRECTORY, $GIT_INDEX_FILE.

...
glob Value

Show all refs matching the shell glob pattern pattern.

...
is_bare_repository Flag

When the repository is bare print "true", otherwise "false".

...
is_inside_git_dir Flag

When the current working directory is below the repository directory print "true", otherwise "false".

...
is_inside_work_tree Flag

When the current working directory is inside the work tree of the repository print "true", otherwise "false".

...
is_shallow_repository Flag

When the repository is shallow print "true", otherwise "false".

...
no_revs Flag

Do not output flags and parameters meant for git rev-list command.

...
not_ Flag

When showing object names, prefix them with ^ and strip ^ prefix from the object names that already have one.

...
output_object_format Flag

Allow oids to be input from any object format that the current repository supports.

...
parseopt Flag

Use git rev-parse in option parsing mode (see PARSEOPT section below).

...
path_format Flag

Controls the behavior of certain other options.

...
prefix Value

Behave as if git rev-parse was invoked from the subdirectory of the working tree. May be repeated: a list emits the flag once per item.

...
quiet Flag

Only meaningful in --verify mode.

...
resolve_git_dir Value

Check if is a valid repository or a gitfile that points at a valid repository, and print the location of the repository.

...
shared_index_path Flag

Show the path to the shared index file in split index mode, or empty if not in split-index mode.

...
short ValuedFlag

Same as --verify but shortens the object name to a unique prefix with at least length characters. Value optional: True for the bare flag, or pass one.

...
show_cdup Flag

When the command is invoked from a subdirectory, show the path of the top-level directory relative to the current directory (typically a sequence of "../", or an empty string).

...
show_object_format ValuedFlag

Show the object format (hash algorithm) used for the repository for storage inside the .git directory, input, output, or compatibility. Value optional: True for the bare flag, or pass one.

...
show_prefix Flag

When the command is invoked from a subdirectory, show the path of the current directory relative to the top-level directory.

...
show_ref_format Flag

Show the reference storage format used for the repository.

...
show_superproject_working_tree Flag

Show the absolute path of the root of the superproject's working tree (if exists) that uses the current repository as its submodule.

...
show_toplevel Flag

Show the (by default, absolute) path of the top-level directory of the working tree.

...
sq Flag

Usually the output is made one line per flag and parameter.

...
sq_quote Flag

Use git rev-parse in shell quoting mode (see SQ-QUOTE section below).

...
stop_at_non_option Flag

Only meaningful in --parseopt mode.

...
stuck_long Flag

Only meaningful in --parseopt mode.

...
symbolic Flag

Usually the object names are output in SHA-1 form (with possible ^ prefix); this option makes them output in a form as close to the original input as possible.

...
symbolic_full_name Flag

This is similar to --symbolic, but it omits input that are not refs (i.e.

...
until Value

Parse the date string, and output the corresponding --min-age= parameter for git rev-list.

...
verify Flag

Verify that exactly one parameter is provided, and that it can be turned into a raw 20-byte SHA-1 that can be used to access the object database.

...

Stash

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    all: Flag = ...,
    include_untracked: Flag = ...,
    index: Flag = ...,
    inter_hunk_context: Value = ...,
    keep_index: Flag = ...,
    label_ours: Value = ...,
    only_untracked: Flag = ...,
    patch: Flag = ...,
    pathspec_file_nul: Flag = ...,
    pathspec_from_file: Value = ...,
    print: Flag = ...,
    quiet: Flag = ...,
    staged: Flag = ...,
    to_ref: Flag = ...,
    unified: Value = ...,
    **flags: Any,
) -> _R2

Stash the changes in a dirty working directory away

Parameters:

Name Type Description Default
all Flag

This option is only valid for push and save commands.

...
include_untracked Flag

When used with the push and save commands, all untracked files are also stashed and then cleaned up with git clean.

...
index Flag

This option is only valid for pop and apply commands.

...
inter_hunk_context Value

Show the context between diff hunks, up to the specified of lines, thereby fusing hunks that are close to each other. Added in 2.51.0.

...
keep_index Flag

This option is only valid for push and save commands.

...
label_ours Value

These options are only valid for the apply command. Added in 2.55.0.

...
only_untracked Flag

This option is only valid for the show command.

...
patch Flag

This option is only valid for push and save commands.

...
pathspec_file_nul Flag

This option is only valid for push command.

...
pathspec_from_file Value

This option is only valid for push command.

...
print Flag

This option is only valid for the export command. Added in 2.51.0.

...
quiet Flag

This option is only valid for apply, drop, pop, push, save, store commands.

...
staged Flag

This option is only valid for push and save commands.

...
to_ref Flag

This option is only valid for the export command. Added in 2.51.0.

...
unified Value

Generate diffs with lines of context. Added in 2.51.0.

...

Status

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    ahead_behind: Flag = ...,
    branch: Flag = ...,
    column: ValuedFlag = ...,
    find_renames: ValuedFlag = ...,
    ignore_submodules: ValuedFlag = ...,
    ignored: ValuedFlag = ...,
    long: Flag = ...,
    porcelain: ValuedFlag = ...,
    renames: Flag = ...,
    short: Flag = ...,
    show_stash: Flag = ...,
    untracked_files: ValuedFlag = ...,
    verbose: Flag = ...,
    z: Flag = ...,
    **flags: Any,
) -> _R2

Show the working tree status

Parameters:

Name Type Description Default
ahead_behind Flag

Display or do not display detailed ahead/behind counts for the branch relative to its upstream branch.

...
branch Flag

Show the branch and tracking info even in short-format.

...
column ValuedFlag

Display untracked files in columns. Value optional: True for the bare flag, or pass one.

...
find_renames ValuedFlag

Turn on rename detection, optionally setting the similarity threshold. Value optional: True for the bare flag, or pass one.

...
ignore_submodules ValuedFlag

Ignore changes to submodules when looking for changes. Value optional: True for the bare flag, or pass one.

...
ignored ValuedFlag

Show ignored files as well. Value optional: True for the bare flag, or pass one.

...
long Flag

Give the output in the long-format.

...
porcelain ValuedFlag

Give the output in an easy-to-parse format for scripts. Value optional: True for the bare flag, or pass one.

...
renames Flag

Turn on/off rename detection regardless of user configuration.

...
short Flag

Give the output in the short-format.

...
show_stash Flag

Show the number of entries currently stashed away.

...
untracked_files ValuedFlag

Show untracked files. Value optional: True for the bare flag, or pass one.

...
verbose Flag

In addition to the names of files that have been changed, also show the textual changes that are staged to be committed (i.e., like the output of git diff --cached).

...
z Flag

Terminate entries with NUL, instead of LF.

...

Switch

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    conflict: Value = ...,
    create: Value = ...,
    detach: Flag = ...,
    discard_changes: Flag = ...,
    force: Flag = ...,
    force_create: Value = ...,
    guess: Flag = ...,
    ignore_other_worktrees: Flag = ...,
    merge: Flag = ...,
    no_track: Flag = ...,
    orphan: Value = ...,
    progress: Flag = ...,
    quiet: Flag = ...,
    recurse_submodules: Flag = ...,
    track: Flag = ...,
    **flags: Any,
) -> _R2

Switch branches

Parameters:

Name Type Description Default
conflict Value

The same as --merge option above, but changes the way the conflicting hunks are presented, overriding the merge.conflictStyle configuration variable.

...
create Value

Create a new branch named starting at before switching to the branch.

...
detach Flag

Switch to a commit for inspection and discardable experiments.

...
discard_changes Flag

Proceed even if the index or the working tree differs from HEAD.

...
force Flag

An alias for --discard-changes.

...
force_create Value

Similar to --create except that if already exists, it will be reset to .

...
guess Flag

If is not found but there does exist a tracking branch in exactly one remote (call it ) with a matching name, treat as equivalent to $ git switch -c --track / If the branch exists in multiple remotes and one of them is named by the checkout.defaultRemote configuration variable, we'll use that one for the purposes of disambiguation, even if the isn't unique across all remotes. guess=off emits --no-guess.

...
ignore_other_worktrees Flag

git switch refuses when the wanted ref is already checked out by another worktree.

...
merge Flag

If you have local modifications to one or more files that are different between the current branch and the branch to which you are switching, the command normally refuses to switch branches in order to preserve your modifications in context.

...
no_track Flag

Do not set up "upstream" configuration, even if the branch.autoSetupMerge configuration variable is true. Gone since 2.50.0.

...
orphan Value

Create a new unborn branch, named .

...
progress Flag

Progress status is reported on the standard error stream by default when it is attached to a terminal, unless --quiet is specified.

...
quiet Flag

Quiet, suppress feedback messages.

...
recurse_submodules Flag

Using --recurse-submodules will update the content of all active submodules according to the commit recorded in the superproject.

...
track Flag

When creating a new branch, set up "upstream" configuration. track=off emits --no-track.

...

Tag

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    annotate: Flag = ...,
    cleanup: Value = ...,
    color: ValuedFlag = ...,
    column: ValuedFlag = ...,
    contains: Value = ...,
    create_reflog: Flag = ...,
    delete: Flag = ...,
    edit: Flag = ...,
    file: Value = ...,
    force: Flag = ...,
    format: Value = ...,
    ignore_case: Flag = ...,
    list: Flag = ...,
    local_user: Value = ...,
    merged: Value = ...,
    message: Value = ...,
    n: Flag = ...,
    no_contains: Value = ...,
    no_merged: Value = ...,
    omit_empty: Flag = ...,
    points_at: Value = ...,
    sign: Flag = ...,
    sort: Value = ...,
    trailer: Value = ...,
    verify: Flag = ...,
    **flags: Any,
) -> _R2

Create, list, delete or verify tags

Parameters:

Name Type Description Default
annotate Flag

Make an unsigned, annotated tag object.

...
cleanup Value

Set how the tag message is cleaned up.

...
color ValuedFlag

Respect any colors specified in the --format option. Value optional: True for the bare flag, or pass one.

...
column ValuedFlag

Display tag listing in columns. Value optional: True for the bare flag, or pass one.

...
contains Value

Only list tags which contain (HEAD if not specified).

...
create_reflog Flag

Create a reflog for the tag.

...
delete Flag

Delete existing tags with the given names.

...
edit Flag

Let further edit the message taken from file with -F and command line with -m.

...
file Value

Take the tag message from .

...
force Flag

Replace an existing tag with the given name (instead of failing).

...
format Value

A string that interpolates %(fieldname) from a tag ref being shown and the object it points at.

...
ignore_case Flag

Sorting and filtering tags are case insensitive.

...
list Flag

List tags.

...
local_user Value

Make a cryptographically signed tag using the given key.

...
merged Value

Only list tags whose commits are reachable from (HEAD if not specified).

...
message Value

Use (instead of prompting).

...
n Flag

specifies how many lines from the annotation, if any, are printed when using -l.

...
no_contains Value

Only list tags which don't contain (HEAD if not specified).

...
no_merged Value

Only list tags whose commits are not reachable from (HEAD if not specified).

...
omit_empty Flag

Do not print a newline after formatted refs where the format expands to the empty string.

...
points_at Value

Only list tags of (HEAD if not specified).

...
sign Flag

Make a cryptographically signed tag, using the default signing key. sign=off emits --no-sign.

...
sort Value

Sort based on the key given.

...
trailer Value

Specify a (, ) pair that should be applied as a trailer. May be repeated: a list emits the flag once per item.

...
verify Flag

Verify the cryptographic signature of the given tags.

...

Worktree

Bases: Tool[_R2]

__call__

__call__(
    *args: str | PathLike[str],
    b: Value = ...,
    checkout: Flag = ...,
    detach: Flag = ...,
    dry_run: Flag = ...,
    expire: Value = ...,
    force: Flag = ...,
    guess_remote: Flag = ...,
    lock: Flag = ...,
    orphan: Flag = ...,
    porcelain: Flag = ...,
    quiet: Flag = ...,
    reason: Value = ...,
    relative_paths: Flag = ...,
    track: Flag = ...,
    verbose: Flag = ...,
    z: Flag = ...,
    **flags: Any,
) -> _R2

Manage multiple working trees

Parameters:

Name Type Description Default
b Value

With add, create a new branch named starting at , and check out into the new worktree.

...
checkout Flag

By default, add checks out , however, --no-checkout can be used to suppress checkout in order to make customizations, such as configuring sparse-checkout. Added in 2.52.0.

...
detach Flag

With add, detach HEAD in the new worktree.

...
dry_run Flag

With prune, do not remove anything; just report what it would remove.

...
expire Value

With prune, only prune missing worktrees if older than

...
force Flag

By default, add refuses to create a new worktree when is a branch name and is already checked out by another worktree, or if is already assigned to some worktree but is missing (for instance, if was deleted manually).

...
guess_remote Flag

With worktree add , without , instead of creating a new branch from HEAD, if there exists a tracking branch in exactly one remote matching the basename of , base the new branch on the remote-tracking branch, and mark the remote-tracking branch as "upstream" from the new branch. Added in 2.52.0.

...
lock Flag

Keep the worktree locked after creation.

...
orphan Flag

With add, make the new worktree and index empty, associating the worktree with a new unborn branch named .

...
porcelain Flag

With list, output in an easy-to-parse format for scripts.

...
quiet Flag

With add, suppress feedback messages.

...
reason Value

With lock or with add --lock, an explanation why the worktree is locked.

...
relative_paths Flag

Link worktrees using relative paths or absolute paths (default). Added in 2.52.0.

...
track Flag

When creating a new branch, if is a branch, mark it as "upstream" from the new branch. Added in 2.52.0.

...
verbose Flag

With prune, report all removals.

...
z Flag

Terminate each line with a NUL rather than a newline when --porcelain is specified with list.

...

__call__

__call__(
    *args: str | PathLike[str],
    C: Value = ...,
    attr_source: Value = ...,
    bare: Flag = ...,
    c: Value = ...,
    config_env: Value = ...,
    exec_path: ValuedFlag = ...,
    git_dir: Value = ...,
    glob_pathspecs: Flag = ...,
    html_path: Flag = ...,
    icase_pathspecs: Flag = ...,
    info_path: Flag = ...,
    list_cmds: Value = ...,
    literal_pathspecs: Flag = ...,
    man_path: Flag = ...,
    namespace: Value = ...,
    no_advice: Flag = ...,
    no_lazy_fetch: Flag = ...,
    no_optional_locks: Flag = ...,
    no_pager: Flag = ...,
    no_replace_objects: Flag = ...,
    noglob_pathspecs: Flag = ...,
    paginate: Flag = ...,
    work_tree: Value = ...,
    **flags: Any,
) -> _R

the stupid content tracker

Parameters:

Name Type Description Default
C Value

Run as if git was started in instead of the current working directory.

...
attr_source Value

Read gitattributes from instead of the worktree.

...
bare Flag

Treat the repository as a bare repository.

...
c Value

Pass a configuration parameter to the command.

...
config_env Value

Like -c =, give configuration variable a value, where is the name of an environment variable from which to retrieve the value.

...
exec_path ValuedFlag

Path to wherever your core Git programs are installed. Value optional: True for the bare flag, or pass one.

...
git_dir Value

Set the path to the repository (".git" directory).

...
glob_pathspecs Flag

Add "glob" magic to all pathspec.

...
html_path Flag

Print the path, without trailing slash, where Git's HTML documentation is installed and exit.

...
icase_pathspecs Flag

Add "icase" magic to all pathspec.

...
info_path Flag

Print the path where the Info files documenting this version of Git are installed and exit.

...
list_cmds Value

List commands by group.

...
literal_pathspecs Flag

Treat pathspecs literally (i.e.

...
man_path Flag

Print the manpath (see man(1)) for the man pages for this version of Git and exit.

...
namespace Value

Set the Git namespace.

...
no_advice Flag

Disable all advice hints from being printed.

...
no_lazy_fetch Flag

Do not fetch missing objects from the promisor remote on demand.

...
no_optional_locks Flag

Do not perform optional operations that require locks.

...
no_pager Flag

Do not pipe Git output into a pager.

...
no_replace_objects Flag

Do not use replacement refs to replace Git objects.

...
noglob_pathspecs Flag

Add "literal" magic to all pathspec.

...
paginate Flag

Pipe all output into less (or if set, $PAGER) if standard output is a terminal.

...
work_tree Value

Set the path to the working tree.

...

flags

flags(
    *,
    C: Value = ...,
    attr_source: Value = ...,
    bare: Flag = ...,
    c: Value = ...,
    config_env: Value = ...,
    exec_path: ValuedFlag = ...,
    git_dir: Value = ...,
    glob_pathspecs: Flag = ...,
    html_path: Flag = ...,
    icase_pathspecs: Flag = ...,
    info_path: Flag = ...,
    list_cmds: Value = ...,
    literal_pathspecs: Flag = ...,
    man_path: Flag = ...,
    namespace: Value = ...,
    no_advice: Flag = ...,
    no_lazy_fetch: Flag = ...,
    no_optional_locks: Flag = ...,
    no_pager: Flag = ...,
    no_replace_objects: Flag = ...,
    noglob_pathspecs: Flag = ...,
    paginate: Flag = ...,
    work_tree: Value = ...,
    **flags: Any,
) -> Self

Bind tool-level global options before the subcommand.

tools.docker.flags(host=...) puts a tool's own options ahead of the verb, where they belong.