Updated
On this page
Reference for the safegit commit command — usage, flags, arguments, and examples for the commit subcommand of the safegit CLI.
#safegit commit
stage and commit specified files in a single atomic operation
Effect: mutating
#Flags
| Name | Short | Type | Default | Env | Description |
|---|---|---|---|---|---|
--m | -m | str | commit message line; can be repeated to build multi-line messages | ||
--F | -F | str | read the full commit message body from a file instead of --m flags | ||
--branch | str | commit the staged files onto a different branch without switching to it | |||
--amend | bool | amend the current HEAD commit by replacing it with updated content | |||
--allow-empty | bool | allow creating a commit even when no files have been changed | |||
--trailer | str | add a key-value trailer line to the commit message (repeatable) |
#Arguments
| Name | Required | Description |
|---|---|---|
files | no | files to commit (supports hunk specs: file.go:1,3) |
#Grants
| Kind | Name | Reason |
|---|---|---|
| proc_mutate | parent-bump | committing in a submodule moves the parent's gitlink, so safegit commits the parent too when commit.autoBumpParent is on |