cg-commit [-mMESSAGE]… [-C] [-e | -E] [FILE]… [< MESSAGE]


Commits changes to a GIT repository. Accepts the commit message from stdin. If the commit message is not modified the commit will be aborted.

The GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL environment variables are used in case values other than that returned by getpwuid(getuid()) are desired when performing a commit.



Make cg-commit ignore the cache and just commit the thing as-is. Note, this is used internally by Cogito when merging. This option does not make sense when files are given on the command line.


Specify the commit message, which is used instead of starting up an editor (if the input is not stdin, the input is appended after all the -m messages). Multiple -m parameters are appended to a single commit message, each as separate paragraph.


Force the editor to be brought up even when -m parameters were passed to cg-commit.


Force the editor to be brought up and do the commit even if the default commit message is not changed.


Force the commit even when there's "nothing to commit", that is the tree is the same as the last time you committed, no changes happenned.


Don't add the files to the object database, just update the caches and the commit information. This is for special purposes when you might not actually _have_ any object database. This option is normally not interesting.

-h, --help

Print usage help.



If exists, it should be in the format Person Name <email@addy> (both parts are optional) and the GIT_AUTHOR_* environment variables will be set accordingly if they are not present in the environment yet.


If the file exists it will be used as a template when creating the commit message. The template file makes it possible to automatically add Signed-off-by line to the log message.


If the file exists and is executable it will be executed upon completion of the commit. The script is passed two arguments. The first argument is the commit ID and the second is the branchname. A sample commit-post script might look like:

echo "Committed $id in $branch" | mail user@host



Author's name


Author's e-mail address


Date, useful when applying patches an e-mail


Committer's name


Committer's e-mail address


The editor used for entering revision log information.


Copyright © Petr Baudis, 2005 Based on an example script fragment sent to LKML by Linus Torvalds.


cg-commit command is part of cogito(7), a toolkit for managing git(1) trees.