GitButler ⧓

Commands

but commit

Commit changes to a stack.

Commit changes to a stack.

Commit changes to a stack.

The but commit command allows you to create a new commit on a specified branch (stack) with the current uncommitted changes.

If there is only one branch applied, it will commit to that branch by default.

If there are multiple branches applied, you must specify which branch to commit to, or if in interactive mode, you will be prompted to select one.

By default, all uncommitted changes and all changes already staged to that branch will be included in the commit. If you only want to commit the changes that are already staged to that branch, you can use the --only flag.

It will not commit changes staged to other branches.

Usage: but commit [BRANCH] [OPTIONS]

Arguments

  • <BRANCH> — Branch CLI ID or name to derive the stack to commit to

Options

  • -m, --message <MESSAGE> — Commit message
  • -f, --file <FILE> — Read commit message from file
  • -c, --create — Whether to create a new branch for this commit. If the branch name given matches an existing branch, that branch will be used instead. If no branch name is given, a new branch with a generated name will be created
  • -o, --only — Only commit staged files, not unstaged files
  • -F, --files <FILES>... — Uncommitted file or hunk CLI IDs to include in the commit. Can be specified multiple times or as comma-separated values. If not specified, all uncommitted changes (or changes staged to the target branch) are committed
  • -j, --json — Whether to use JSON output format
  • -n, --no-hooks — Bypass pre-commit hooks
  • -i, --ai [<AI>] — Generate commit message using AI with optional user summary

Subcommands

  • empty — Insert a blank commit before or after a specified commit. Use but commit empty --before <target> or but commit empty --after <target> to create a placeholder commit that you can amend changes into later using but mark, but rub or but absorb

Last updated on

On this page

Edit on GitHubGive us feedback