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

[PATCH v4 1/2] doc: git-add: clarify intro & add an example

From
Julia Evans via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 29, 2025, 11:55 UTC
Message-ID
<57947d5a3effa3cafb7b4e69f5c9e999b0cc5c30.1756468502.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1952.v4.git.1756468502.gitgitgadget@gmail.com>
From: Julia Evans <julia@jvns.ca>
- Add a basic example of how "git add" is normally used
- It's not technically true that you *must* use the `add` command to
  add changes before running `git commit`, because `git commit -a`
  exists. Instead say that you *can* use the `add` command.
- Mention early on that "index" is another word for "staging area",
  since Git very rarely uses the word "index" in its output
  (`git status`) uses the term "staged", and many Git users are
  unfamiliar with the term "index"
- Remove "It typically adds" (it's not clear what "typically" means),
  and instead mention that `git add -p` can be used to add
  partial contents
- Currently the introduction is somewhat repetitive ("to prepare the
  content staged for the next commit" ... "this snapshot that is taken
  as the contents of the next commit."), replace with a single sentence
  ("The "index" [...] is where Git stores the contents of the next
  commit.")
Signed-off-by: Julia Evans <julia@jvns.ca>
---
 Documentation/git-add.adoc | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/Documentation/git-add.adoc b/Documentation/git-add.adoc
index b7a735824d..ffe8fd701a 100644
--- a/Documentation/git-add.adoc
+++ b/Documentation/git-add.adoc
@@ -16,18 +16,18 @@ git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [-
 
 DESCRIPTION
 -----------
-This command updates the index using the current content found in
-the working tree, to prepare the content staged for the next commit.
-It typically adds the current content of existing paths as a whole,
-but with some options it can also be used to add content with
-only part of the changes made to the working tree files applied, or
-remove paths that do not exist in the working tree anymore.
-
-The "index" holds a snapshot of the content of the working tree, and it
-is this snapshot that is taken as the contents of the next commit.  Thus
-after making any changes to the working tree, and before running
-the commit command, you must use the `add` command to add any new or
-modified files to the index.
+Add contents of new or changed files to the index. The "index" (also
+known as the "staging area") is what you use to prepare the contents of
+the next commit.
+
+When you run `git commit` without any other arguments, it will only
+commit staged changes. For example, if you've edited `file.c` and want
+to commit your changes to that file, you can run:
+
+   git add file.c
+   git commit
+
+You can also add only part of your changes to a file with `git add -p`.
 
 This command can be performed multiple times before a commit.  It only
 adds the content of the specified file(s) at the time the add command is
-- 
gitgitgadget
Previous: Julia Evans via GitGitGadgetNext: Julia Evans via GitGitGadget
Message 57 of 59 in “doc: git-add: clarify DESCRIPTION section”
  1. 0/5 doc: git-add: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Aug 12, 2025
  2. 1/5 doc: git-add: remove options from SYNOPSISJulia Evans via GitGitGadget, Aug 12, 2025
  3. Junio C HamanoAug 12, 2025
  4. Julia EvansAug 13, 2025
  5. Jean-Noël AVILAAug 13, 2025
  6. 2/5 doc: git-add: start man page with an exampleJulia Evans via GitGitGadget, Aug 12, 2025
  7. Junio C HamanoAug 12, 2025
  8. Julia EvansAug 12, 2025
  9. Junio C HamanoAug 12, 2025
  10. Julia EvansAug 12, 2025
  11. D. Ben KnobleAug 13, 2025
  12. Junio C HamanoAug 14, 2025
  13. Julia EvansAug 14, 2025
  14. Junio C HamanoAug 15, 2025
  15. 3/5 doc: git-add: simplify discussion of ignored filesJulia Evans via GitGitGadget, Aug 12, 2025
  16. D. Ben KnobleAug 13, 2025
  17. 4/5 doc: git-add: make explanation less dryJulia Evans via GitGitGadget, Aug 12, 2025
  18. 5/5 doc: git-add: explain inconsistent terminologyJulia Evans via GitGitGadget, Aug 12, 2025
  19. Chris TorekAug 12, 2025
  20. Junio C HamanoAug 12, 2025
  21. Julia EvansAug 12, 2025
  22. 0/4 doc: git-add: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Aug 13, 2025
  23. 1/4 doc: git-add: start man page with an exampleJulia Evans via GitGitGadget, Aug 13, 2025
  24. Junio C HamanoAug 15, 2025
  25. Jean-Noël AVILAAug 15, 2025
  26. Junio C HamanoAug 15, 2025
  27. Jean-Noël AVILAAug 17, 2025
  28. Julia EvansAug 19, 2025
  29. 2/4 doc: git-add: simplify discussion of ignored filesJulia Evans via GitGitGadget, Aug 13, 2025
  30. D. Ben KnobleAug 14, 2025
  31. Junio C HamanoAug 14, 2025
  32. 3/4 doc: git-add: make explanation less dryJulia Evans via GitGitGadget, Aug 13, 2025
  33. Junio C HamanoAug 14, 2025
  34. Julia EvansAug 15, 2025
  35. D. Ben KnobleAug 15, 2025
  36. Junio C HamanoAug 15, 2025
  37. D. Ben KnobleAug 16, 2025
  38. Junio C HamanoAug 15, 2025
  39. Julia EvansAug 19, 2025
  40. Jean-Noël AVILAAug 21, 2025
  41. 4/4 doc: git-add: explain inconsistent terminologyJulia Evans via GitGitGadget, Aug 13, 2025
  42. Junio C HamanoAug 14, 2025
  43. Julia EvansAug 19, 2025
  44. 0/3 doc: git-add: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Aug 19, 2025
  45. 1/3 Git 2.51Junio C Hamano via GitGitGadget, Aug 19, 2025
  46. rsbecker@nexbridge.comAug 19, 2025
  47. Junio C HamanoAug 19, 2025
  48. D. Ben KnobleAug 19, 2025
  49. Julia EvansAug 19, 2025
  50. rsbecker@nexbridge.comAug 19, 2025
  51. 3/3 doc: git-add: simplify discussion of ignored filesJulia Evans via GitGitGadget, Aug 19, 2025
  52. Junio C HamanoAug 21, 2025
  53. 2/3 doc: git-add: clarify intro & add an exampleJulia Evans via GitGitGadget, Aug 19, 2025
  54. Junio C HamanoAug 21, 2025
  55. Julia EvansAug 22, 2025
  56. 0/2 doc: git-add: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Aug 29, 2025
  57. 1/2 doc: git-add: clarify intro & add an exampleJulia Evans via GitGitGadget, Aug 29, 2025
  58. 2/2 doc: git-add: simplify discussion of ignored filesJulia Evans via GitGitGadget, Aug 29, 2025
  59. Junio C HamanoAug 29, 2025

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.