Documentation / git-add.txton commit Merge branch 'jc/diff--cached' (67bed72)
   1git-add(1)
   2==========
   3
   4NAME
   5----
   6git-add - Add file contents to the changeset to be committed next
   7
   8SYNOPSIS
   9--------
  10'git-add' [-n] [-v] [--] <file>...
  11
  12DESCRIPTION
  13-----------
  14All the changed file contents to be committed together in a single set
  15of changes must be "added" with the 'add' command before using the
  16'commit' command.  This is not only for adding new files.  Even modified
  17files must be added to the set of changes about to be committed.
  18
  19This command can be performed multiple times before a commit. The added
  20content corresponds to the state of specified file(s) at the time the
  21'add' command is used. This means the 'commit' command will not consider
  22subsequent changes to already added content if it is not added again before
  23the commit.
  24
  25The 'git status' command can be used to obtain a summary of what is included
  26for the next commit.
  27
  28This command only adds non-ignored files, to add ignored files use
  29"git update-index --add".
  30
  31Please see gitlink:git-commit[1] for alternative ways to add content to a
  32commit.
  33
  34
  35OPTIONS
  36-------
  37<file>...::
  38        Files to add content from.
  39
  40-n::
  41        Don't actually add the file(s), just show if they exist.
  42
  43-v::
  44        Be verbose.
  45
  46\--::
  47        This option can be used to separate command-line options from
  48        the list of files, (useful when filenames might be mistaken
  49        for command-line options).
  50
  51
  52EXAMPLES
  53--------
  54git-add Documentation/\\*.txt::
  55
  56        Adds content from all `\*.txt` files under `Documentation`
  57        directory and its subdirectories.
  58+
  59Note that the asterisk `\*` is quoted from the shell in this
  60example; this lets the command to include the files from
  61subdirectories of `Documentation/` directory.
  62
  63git-add git-*.sh::
  64
  65        Considers adding content from all git-*.sh scripts.
  66        Because this example lets shell expand the asterisk
  67        (i.e. you are listing the files explicitly), it does not
  68        consider `subdir/git-foo.sh`.
  69
  70See Also
  71--------
  72gitlink:git-status[1]
  73gitlink:git-rm[1]
  74gitlink:git-mv[1]
  75gitlink:git-commit[1]
  76gitlink:git-update-index[1]
  77
  78Author
  79------
  80Written by Linus Torvalds <torvalds@osdl.org>
  81
  82Documentation
  83--------------
  84Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
  85
  86GIT
  87---
  88Part of the gitlink:git[7] suite
  89