@@ -327,24 +327,28 @@ <h2>SYNOPSIS</h2>
327327</ div >
328328< h2 id ="_description "> DESCRIPTION</ h2 >
329329< div class ="sectionbody ">
330- < div class ="para "> < p > This command adds the current content of new or modified files to the
331- index, thus staging that content for inclusion in the next commit.</ p > </ div >
330+ < div class ="para "> < p > This command updates the index using the current content found in
331+ the working tree, to prepare the content staged for the next commit.
332+ It typically adds the current content of existing paths as a whole,
333+ but with some options it can also be used to add content with
334+ only part of the changes made to the working tree files applied, or
335+ remove paths that do not exist in the working tree anymore.</ p > </ div >
332336< div class ="para "> < p > The "index" holds a snapshot of the content of the working tree, and it
333337is this snapshot that is taken as the contents of the next commit. Thus
334338after making any changes to the working directory, and before running
335- the commit command, you must use the < em > add</ em > command to add any new or
339+ the commit command, you must use the < tt > add</ tt > command to add any new or
336340modified files to the index.</ p > </ div >
337341< div class ="para "> < p > This command can be performed multiple times before a commit. It only
338342adds the content of the specified file(s) at the time the add command is
339343run; if you want subsequent changes included in the next commit, then
340- you must run < em > git add</ em > again to add the new content to the index.</ p > </ div >
341- < div class ="para "> < p > The < em > git status</ em > command can be used to obtain a summary of which
344+ you must run < tt > git add</ tt > again to add the new content to the index.</ p > </ div >
345+ < div class ="para "> < p > The < tt > git status</ tt > command can be used to obtain a summary of which
342346files have changes that are staged for the next commit.</ p > </ div >
343- < div class ="para "> < p > The < em > git add</ em > command will not add ignored files by default. If any
344- ignored files were explicitly specified on the command line, < em > git add</ em >
347+ < div class ="para "> < p > The < tt > git add</ tt > command will not add ignored files by default. If any
348+ ignored files were explicitly specified on the command line, < tt > git add</ tt >
345349will fail with a list of ignored files. Ignored files reached by
346350directory recursion or filename globbing performed by Git (quote your
347- globs before the shell) will be silently ignored. The < em > add</ em > command can
351+ globs before the shell) will be silently ignored. The < tt > add</ tt > command can
348352be used to add ignored files with the < tt > -f</ tt > (force) option.</ p > </ div >
349353< div class ="para "> < p > Please see < a href ="git-commit.html "> git-commit(1)</ a > for alternative ways to add content to a
350354commit.</ p > </ div >
@@ -449,14 +453,16 @@ <h2 id="_options">OPTIONS</h2>
449453</ dt >
450454< dd >
451455< p >
452- Update only files that git already knows about, staging modified
453- content for commit and marking deleted files for removal. This
454- is similar
455- to what "git commit -a" does in preparation for making a commit,
456- except that the update is limited to paths specified on the
457- command line. If no paths are specified, all tracked files in the
458- current directory and its subdirectories are updated.
456+ Only match <filepattern> against already tracked files in
457+ the index rather than the working tree. That means that it
458+ will never stage new files, but that it will stage modified
459+ new contents of tracked files and that it will remove files
460+ from the index if the corresponding files in the working tree
461+ have been removed.
459462</ p >
463+ < div class ="para "> < p > If no <filepattern> is given, default to "."; in other words,
464+ update all tracked files in the current directory and its
465+ subdirectories.</ p > </ div >
460466</ dd >
461467< dt >
462468-A
@@ -466,9 +472,10 @@ <h2 id="_options">OPTIONS</h2>
466472</ dt >
467473< dd >
468474< p >
469- Update files that git already knows about (same as < em > --update</ em > )
470- and add all untracked files that are not ignored by < em > .gitignore</ em >
471- mechanism.
475+ Like < tt > -u</ tt > , but match <filepattern> against files in the
476+ working tree in addition to the index. That means that it
477+ will find new files as well as staging modified content and
478+ removing files that are no longer in the working tree.
472479</ p >
473480</ dd >
474481< dt >
@@ -482,8 +489,8 @@ <h2 id="_options">OPTIONS</h2>
482489 Record only the fact that the path will be added later. An entry
483490 for the path is placed in the index with no content. This is
484491 useful for, among other things, showing the unstaged content of
485- such files with < em > git diff</ em > and committing them with < em > git commit
486- -a</ em > .
492+ such files with < tt > git diff</ tt > and committing them with < tt > git commit
493+ -a</ tt > .
487494</ p >
488495</ dd >
489496< dt >
@@ -519,7 +526,7 @@ <h2 id="_options">OPTIONS</h2>
519526</ div >
520527< h2 id ="_configuration "> Configuration</ h2 >
521528< div class ="sectionbody ">
522- < div class ="para "> < p > The optional configuration variable < em > core.excludesfile</ em > indicates a path to a
529+ < div class ="para "> < p > The optional configuration variable < tt > core.excludesfile</ tt > indicates a path to a
523530file containing patterns of file names to exclude from git-add, similar to
524531$GIT_DIR/info/exclude. Patterns in the exclude file are used in addition to
525532those in info/exclude. See < a href ="gitrepository-layout.html "> gitrepository-layout(5)</ a > .</ p > </ div >
@@ -570,7 +577,7 @@ <h2 id="_interactive_mode">Interactive mode</h2>
570577 5: patch 6: diff 7: quit 8: help
571578 What now> 1</ tt > </ pre >
572579</ div > </ div >
573- < div class ="para "> < p > You also could say "s" or " sta" or " status" above as long as the
580+ < div class ="para "> < p > You also could say < tt > s </ tt > or < tt > sta</ tt > or < tt > status</ tt > above as long as the
574581choice is unique.</ p > </ div >
575582< div class ="para "> < p > The main command loop has 6 subcommands (plus help and quit).</ p > </ div >
576583< div class ="vlist "> < dl >
@@ -580,9 +587,9 @@ <h2 id="_interactive_mode">Interactive mode</h2>
580587< dd >
581588< p >
582589 This shows the change between HEAD and index (i.e. what will be
583- committed if you say " git commit" ), and between index and
590+ committed if you say < tt > git commit</ tt > ), and between index and
584591 working tree files (i.e. what you could stage further before
585- " git commit" using " git- add" ) for each path. A sample output
592+ < tt > git commit</ tt > using < tt > git add</ tt > ) for each path. A sample output
586593 looks like this:
587594</ p >
588595< div class ="listingblock ">
@@ -714,7 +721,7 @@ <h2 id="_git">GIT</h2>
714721</ div >
715722< div id ="footer ">
716723< div id ="footer-text ">
717- Last updated 2009-12-03 09:12:25 UTC
724+ Last updated 2010-01-08 07:39:28 UTC
718725</ div >
719726</ div >
720727</ body >
0 commit comments