Skip to content

Commit 16e1a62

Browse files
committed
doc: git-add: make explanation less dry
- use examples - mention `git diff --staged` - link to git diff man page Signed-off-by: Julia Evans <[email protected]>
1 parent 9f8a8ad commit 16e1a62

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Documentation/git-add.adoc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ You can also add only part of your changes to a file with `git add -p`.
3131
Please see linkgit:git-commit[1] for alternative ways to add content to
3232
a commit.
3333

34-
This command can be performed multiple times before a commit. It only
35-
adds the content of the specified file(s) at the time the add command is
36-
run; if you want subsequent changes included in the next commit, then
37-
you must run `git add` again to add the new content to the index.
34+
`git add` only adds the changes at the time that you run it. If you edit
35+
`file.c` after adding it, you need to run `git add file.c` again before
36+
committing.
3837

39-
The `git status` command can be used to obtain a summary of which
40-
files have changes that are staged for the next commit.
38+
If you want to check which changes have been added, you can run
39+
`git status` to print out a summary of the changes that will be committed
40+
or run `git diff --staged` to see the full diff.
4141

4242
`git add` will not add ignored files by default. You can use the
4343
`--force` option to add ignored files. If you explicitly specify the
@@ -448,6 +448,7 @@ linkgit:git-rm[1]
448448
linkgit:git-reset[1]
449449
linkgit:git-mv[1]
450450
linkgit:git-commit[1]
451+
linkgit:git-diff[1]
451452
linkgit:git-update-index[1]
452453

453454
GIT

0 commit comments

Comments
 (0)