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

[PATCH v3 0/3] doc: git-add: clarify DESCRIPTION section

From
Julia Evans via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 19, 2025, 20:46 UTC
Message-ID
<pull.1952.v3.git.1755636370.gitgitgadget@gmail.com>
In-Reply-To
<pull.1952.v2.git.1755127218.gitgitgadget@gmail.com>
 * Emphasize "contents" more than "files" in the introduction
 * Delete the terminology note, and just keep a single parenthetical "(also
   known as "staging area")"
 * Be more explicit about what "By default" means
 * Don't mention git diff --cached, mentioning more and more related
   commands felt like it was starting to get messy (what about git diff?
   what about git reset? what about git rm?).
 * Leave the "This command can be performed multiple times before a
   commit"... paragraph alone since the only 2 users who commented on it
   said it was clear and helpful already.
 * Move "Please see linkgit:git-commit[1].." back to the end, where it used
   to be
Julia Evans (2):
  doc: git-add: clarify intro & add an example
  doc: git-add: simplify discussion of ignored files
Junio C Hamano (1):
  Git 2.51
 Documentation/git-add.adoc | 34 ++++++++++++++++------------------
 GIT-VERSION-GEN            |  2 +-
 2 files changed, 17 insertions(+), 19 deletions(-)
base-commit: e5ab6b3e5a3f0a94a429526e0fe6f491955ac053
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1952%2Fjvns%2Fclarify-add-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1952/jvns/clarify-add-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/1952
Range-diff vs v2:
 -:  ----------- > 1:  c44beea485f Git 2.51
 1:  d041d09589b ! 2:  080720c0599 doc: git-add: start man page with an example
     @@ Metadata
      Author: Julia Evans <julia@jvns.ca>
      
       ## Commit message ##
     -    doc: git-add: start man page with an example
     +    doc: git-add: clarify intro & add an example
      
     -    - Replace the intro paragraph of the `git-add` man page with an
     -      example to try to clarify it for new users. The goal here is use less
     -      jargon but communicate essentially the same information.
     -    - Give an example of how to add only part of the changes to the file
     -    - Remove the snapshot-based explanation of the index and replace it with
     -      a diff-based explanation because I don't feel that it's useful in this
     -      context to emphasize  that git uses a snapshot-based model: the main
     -      way most git users interact with the index is through `git diff` or
     -      `git status`, which is a completely diff-based view of the index.
     +    - 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 ##
     -@@ Documentation/git-add.adoc: git-add(1)
     - 
     - NAME
     - ----
     --git-add - Add file contents to the index
     -+git-add - Add new or changed files to the index
     - 
     - SYNOPSIS
     - --------
      @@ Documentation/git-add.adoc: git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [-
       
       DESCRIPTION
     @@ Documentation/git-add.adoc: git add [--verbose | -v] [--dry-run | -n] [--force |
      -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 new or changed files to the index to prepare for a commit. The
     -+"index" (also known as "staging area") is where Git stores the changes
     -+that will be in the next commit.
     ++Add contents of new or changed files to the index. The "index" (also
     ++known as "staging area") is where Git stores the contents of the next
     ++commit.
      +
     -+By default, `git commit` only commits changes that you've added to the
     -+index. For example, if you've edited `file.c` and want to commit your
     -+changes, you can run:
     ++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`.
     -+Please see linkgit:git-commit[1] for alternative ways to add content to
     -+a commit.
       
       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
     -@@ Documentation/git-add.adoc: directory recursion or filename globbing performed by Git (quote your
     - globs before the shell) will be silently ignored.  The `git add` command can
     - be used to add ignored files with the `-f` (force) option.
     - 
     --Please see linkgit:git-commit[1] for alternative ways to add content to a
     --commit.
     --
     --
     - OPTIONS
     - -------
     - `<pathspec>...`::
 2:  63c9e0361dc ! 3:  fc2ec305a9e doc: git-add: simplify discussion of ignored files
     @@ Commit message
      
          - Mention the --force option earlier
          - Remove the explanation of shell globbing vs git's internal glob
     -      system, it's a common gotcha but I don't think this is an appropriate
     -      place to explain that concept. There's some discussion of the gotchas
     -      around globbing and `git add` in the EXAMPLES section which I think
     -      is clearer.
     +      system, since users are confused by it and there's a clearer
     +      discussion in the EXAMPLES section.
      
          Signed-off-by: Julia Evans <julia@jvns.ca>
      
     @@ Documentation/git-add.adoc: you must run `git add` again to add the new content
      -directory recursion or filename globbing performed by Git (quote your
      -globs before the shell) will be silently ignored.  The `git add` command can
      -be used to add ignored files with the `-f` (force) option.
     -+`git add` will not add ignored files by default. You can use the
     -+`--force` option to add ignored files. If you explicitly specify the
     -+exact filename of an ignored file (e.g. `git add ignored.txt`), `git
     -+add` will fail with a list of ignored files. Otherwise it will silently
     -+ignore the file.
     ++The `git add` command will not add ignored files by default. You can
     ++use the `--force` option to add ignored files. If you specify the exact
     ++filename of an ignored file, `git add` will fail with a list of ignored
     ++files. Otherwise it will silently ignore the file.
       
     - OPTIONS
     - -------
     + Please see linkgit:git-commit[1] for alternative ways to add content to a
     + commit.
 3:  ce1eafb0286 < -:  ----------- doc: git-add: make explanation less dry
 4:  9e595f9ad59 < -:  ----------- doc: git-add: explain inconsistent terminology
-- 
gitgitgadget
Previous: Julia EvansNext: Junio C Hamano via GitGitGadget
Message 44 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.