git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Documentation: clarify that git-commit only works with tracked files

From
Jonathan Nieder <jrnieder@uchicago.edu>
Date
Aug 7, 2008, 00:15 UTC
Message-ID
<Pine.GSO.4.62.0808061906490.24977@harper.uchicago.edu>
In-Reply-To
<Pine.GSO.4.62.0808061725450.21683@harper.uchicago.edu>

A user unfamiliar with CVS might not realize that a git-add is needed before commiting new files. So emphasize that "git commit <path>..." only commits files already in the index.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
---
	I keep on forgetting and getting annoyed when "git commit
	newfile.c" does not work.  From the same confusion I suggested
	git commit -A without really thinking about what it meant.
	This change should make the behavior easier to understand
	and remember.  Thanks for the help.
 Documentation/git-commit.txt |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 0e25bb8..9b00ccb 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -27,9 +27,10 @@ The content to be added can be specified in several ways:
 2. by using 'git-rm' to remove files from the working tree
    and the index, again before using the 'commit' command;
 
-3. by listing files as arguments to the 'commit' command, in which
-   case the commit will ignore changes staged in the index, and instead
-   record the current content of the listed files;
+3. by listing some known files as arguments to the 'commit'
+   command, in which case the commit will ignore changes staged
+   in the index and instead record the current content of the
+   listed files;
 
 4. by using the -a switch with the 'commit' command to automatically
    "add" changes from all known files (i.e. all files that are already
-- 
1.6.0.rc1.91.gf0c3
Previous: Jonathan NiederNext: Johannes Schindelin
Message 5 of 10 in “Documentation: user-manual: "git commit -a" doesn't motivate .gitignore”
  1. Jonathan NiederAug 6, 2008
  2. Miklos VajnaAug 6, 2008
  3. Jonathan NiederAug 6, 2008
  4. Jonathan NiederAug 6, 2008
  5. Documentation: clarify that git-commit only works with tracked filesJonathan Nieder, Aug 7, 2008
  6. Johannes SchindelinAug 7, 2008
  7. Jonathan NiederAug 7, 2008
  8. Miklos VajnaAug 7, 2008
  9. Peter KreftingAug 7, 2008
  10. J. Bruce FieldsAug 7, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.