The [commit] Command
commit
Record changes to the repository
Usage
libra commit [OPTIONS] --message <MESSAGE>
Description
Create a new commit containing the current contents of the index and the given log message describing the changes. The new commit is a direct child of HEAD, usually the current head of the current branch, or a single commit hash (detached HEAD).
The content to be committed can be specified only by libra add
& libra rm
commands. (The git support other ways to add content to the index, for example, --all
option in git commit
, which is not supported in libra yet.)
If the --allow-empty
option is not given, the commit will be aborted if the index is empty.
Options:
-m
,--message <MESSAGE>
--allow-empty
Allow commit with empty index.--conventional
Check if the commit message is conventional format, if not, the commit will be aborted.-h
,--help
Print help
Note:
The commit message should align with Git’s behavior as closely as possible, excpet the --conventional
option, which is not supported in Git. Refs https://git-scm.com/docs/git-commit for more information.
The --conventional
option's format is based on the Conventional Commits specification.