]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-commit.txt
Merge branches 'bf/doc' and 'db/tartree'
[thirdparty/git.git] / Documentation / git-commit.txt
CommitLineData
215a7ad1
JH
1git-commit(1)
2=============
62033318
JH
3
4NAME
5----
215a7ad1 6git-commit - Record your changes
62033318
JH
7
8SYNOPSIS
9--------
353ce815
JF
10[verse]
11'git-commit' [-a] [-s] [-v] [(-c | -C) <commit> | -F <file> | -m <msg>]
12 [-e] [--] <file>...
62033318
JH
13
14DESCRIPTION
15-----------
16Updates the index file for given paths, or all modified files if
17'-a' is specified, and makes a commit object. The command
18VISUAL and EDITOR environment variables to edit the commit log
19message.
20
6d35cc76
JH
21This command can run `commit-msg`, `pre-commit`, and
22`post-commit` hooks. See link:hooks.html[hooks] for more
23information.
24
62033318
JH
25OPTIONS
26-------
eaa54efc 27-a|--all::
cb95bf48
JH
28 Update all paths in the index file. This flag notices
29 files that have been modified and deleted, but new files
8278ac2f 30 you have not told git about are not affected.
62033318
JH
31
32-c or -C <commit>::
33 Take existing commit object, and reuse the log message
34 and the authorship information (including the timestamp)
35 when creating the commit. With '-C', the editor is not
36 invoked; with '-c' the user can further edit the commit
37 message.
38
39-F <file>::
40 Take the commit message from the given file. Use '-' to
41 read the message from the standard input.
42
43-m <msg>::
44 Use the given <msg> as the commit message.
45
eaa54efc 46-s|--signoff::
3f971fc4
JH
47 Add Signed-off-by line at the end of the commit message.
48
eaa54efc 49-v|--verify::
3f971fc4
JH
50 Look for suspicious lines the commit introduces, and
51 abort committing if there is one. The definition of
52 'suspicious lines' is currently the lines that has
53 trailing whitespaces, and the lines whose indentation
54 has a SP character immediately followed by a TAB
eaa54efc 55 character. This is the default.
3f971fc4 56
eaa54efc
NW
57-n|--no-verify::
58 The opposite of `--verify`.
59
60-e|--edit::
6d35cc76
JH
61 The message taken from file with `-F`, command line with
62 `-m`, and from file with `-C` are usually used as the
63 commit log message unmodified. This option lets you
64 further edit the message taken from these sources.
65
eaa54efc
NW
66--::
67 Do not interpret any more arguments as options.
68
62033318 69<file>...::
6d35cc76 70 Update specified paths in the index file before committing.
62033318
JH
71
72
3ae854c3
JH
73If you make a commit and then found a mistake immediately after
74that, you can recover from it with gitlink:git-reset[1].
75
76
62033318
JH
77Author
78------
3f971fc4
JH
79Written by Linus Torvalds <torvalds@osdl.org> and
80Junio C Hamano <junkio@cox.net>
81
62033318
JH
82
83GIT
84---
a7154e91 85Part of the gitlink:git[7] suite