but commit
Create a commit.
By default, all uncommitted changes are included in the commit. This can be controlled with
change flags such as --empty and --interactive, or by providing CHANGES as positional
arguments.
If there are no branches applied, a new branch is created for the commit. If there is only one
stack of branches applied, the commit is placed at the tip of that stack. Otherwise, the
targeting flags --above, --below and --branch control where the commit is placed. Note
that only one of the targeting flags can be provided at a time.
The commit is expected to have a commit message unless --no-message is provided. If neither of
--no-message nor --message is provided, the user's preferred editor is opened to input a
message.
For more details about CLI IDs, see but help cli-ids.
Usage: but commit [CHANGES] [OPTIONS]
Arguments
<CHANGES>— One or more changes to commit.
A change can either be a file or a hunk.
Options
-m,--message<MESSAGE>— The message to use for the commit.
Can be supplied any amount of times, each value being appended to the preceding ones with a blank line in between.
--no-message— Creates the commit without a commit message-b,--branch<BRANCH>— Place the commit on the branch BRANCH.
If BRANCH does not exist, it is created as an unstacked branch.
If BRANCH is omitted, an unstacked branch with a generated name is created.
Attempting to place a commit on a branch that exists but is not applied is an error.
-A,--above<BRANCH_OR_COMMIT>— Place the commit above BRANCH_OR_COMMIT, which must be an applied branch or commit.
If BRANCH_OR_COMMIT is a commit, the new commit is placed on the same branch as the targeted commit.
If BRANCH_OR_COMMIT is a branch, the new commit is placed on a new branch above the targeted branch.
-B,--below<BRANCH_OR_COMMIT>— Place the commit below BRANCH_OR_COMMIT, which must be an applied branch or commit.
If BRANCH_OR_COMMIT is a commit, the new commit is placed on the same branch as the targeted commit.
If BRANCH_OR_COMMIT is a branch, the new commit is placed on a new branch below the targeted branch. Branches are treated as buckets, meaning that "below a branch" is treated as below the oldest ancestor on that branch.
--empty— Forces the commit to be empty regardless of repository state-i,--interactive— Open the TUI to interactively select what to commit--allow-merged— Allow targeting branches and commits that are already merged upstream.
By default, mutations refuse to touch history that has landed in the target branch, since the results tend to conflict on the next but pull.
Last updated on