Skip to content

Commit 7431596

Browse files
pcloudsgitster
authored andcommitted
git-commit.txt: clarify --patch mode with pathspec
How pathspec is used, with and without --interactive/--patch, is different. But this is not clear from the document. These changes hint the user to keep reading (to option #5) instead of stopping at #2 and assuming --patch/--interactive behaves the same way. And since all the options listed here always mention how the index is involved (or not) in the final commit, add that bit for #5 as well. This "on top of the index" is implied when you head over git-add(1), but if you just go straight to the "Interactive mode" and not read what git-add is for, you may miss it. Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0b65a8d commit 7431596

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Documentation/git-commit.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ The content to be added can be specified in several ways:
2929
2. by using 'git rm' to remove files from the working tree
3030
and the index, again before using the 'commit' command;
3131

32-
3. by listing files as arguments to the 'commit' command, in which
32+
3. by listing files as arguments to the 'commit' command
33+
(without --interactive or --patch switch), in which
3334
case the commit will ignore changes staged in the index, and instead
3435
record the current content of the listed files (which must already
3536
be known to Git);
@@ -41,7 +42,8 @@ The content to be added can be specified in several ways:
4142
actual commit;
4243

4344
5. by using the --interactive or --patch switches with the 'commit' command
44-
to decide one by one which files or hunks should be part of the commit,
45+
to decide one by one which files or hunks should be part of the commit
46+
in addition to contents in the index,
4547
before finalizing the operation. See the ``Interactive Mode'' section of
4648
linkgit:git-add[1] to learn how to operate these modes.
4749

0 commit comments

Comments
 (0)