]> git.ipfire.org Git - thirdparty/git.git/commit
doc: git-add: clarify intro & add an example
authorJulia Evans <julia@jvns.ca>
Tue, 19 Aug 2025 20:46:09 +0000 (20:46 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Aug 2025 23:04:52 +0000 (16:04 -0700)
commitd14147c0ab84bf4d08adedb4d1a4e99511c56375
tree81f2a3ff5c903338685dbc26d8f3db96007c5476
parentc44beea485f0f2feaf460e2ac87fdd5608d63cf0
doc: git-add: clarify intro & add an example

- 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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-add.adoc