SYNOPSIS

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

DESCRIPTION

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.

OPTIONS

-C

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.

-mMESSAGE

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.

-e

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

-E

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

-f

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.

-N

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.

FILES

$GIT_DIR/author

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.

$GIT_DIR/commit-template

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.

$GIT_DIR/hooks/commit-post

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:

#!/bin/sh
id=$1
branch=$2
echo "Committed $id in $branch" | mail user@host

ENVIRONMENT VARIABLES

GIT_AUTHOR_NAME

Author's name

GIT_AUTHOR_EMAIL

Author's e-mail address

GIT_AUTHOR_DATE

Date, useful when applying patches an e-mail

GIT_COMMITTER_NAME

Committer's name

GIT_COMMITTER_EMAIL

Committer's e-mail address

EDITOR

The editor used for entering revision log information.

COPYRIGHT

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

SEE ALSO

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