Documentation / git-add.txton commit Merge branch 'jc/pack' into next (9c3592c)
   1git-add(1)
   2==========
   3
   4NAME
   5----
   6git-add - Add files to the index file.
   7
   8SYNOPSIS
   9--------
  10'git-add' [-n] [-v] [--] <file>...
  11
  12DESCRIPTION
  13-----------
  14A simple wrapper for git-update-index to add files to the index,
  15for people used to do "cvs add".
  16
  17
  18OPTIONS
  19-------
  20<file>...::
  21        Files to add to the index.
  22
  23-n::
  24        Don't actually add the file(s), just show if they exist.
  25
  26-v::
  27        Be verbose.
  28
  29--::
  30        This option can be used to separate command-line options from
  31        the list of files, (useful when filenames might be mistaken
  32        for command-line options).
  33
  34
  35DISCUSSION
  36----------
  37
  38The list of <file> given to the command is fed to `git-ls-files`
  39command to list files that are not registered in the index and
  40are not ignored/excluded by `$GIT_DIR/info/exclude` file or
  41`.gitignore` file in each directory.  This means two things:
  42
  43. You can put the name of a directory on the command line, and
  44  the command will add all files in it and its subdirectories;
  45
  46. Giving the name of a file that is already in index does not
  47  run `git-update-index` on that path.
  48
  49
  50EXAMPLES
  51--------
  52git-add Documentation/\\*.txt::
  53
  54        Adds all `\*.txt` files that are not in the index under
  55        `Documentation` directory and its subdirectories.
  56+
  57Note that the asterisk `\*` is quoted from the shell in this
  58example; this lets the command to include the files from
  59subdirectories of `Documentation/` directory.
  60
  61git-add git-*.sh::
  62
  63        Adds all git-*.sh scripts that are not in the index.
  64        Because this example lets shell expand the asterisk
  65        (i.e. you are listing the files explicitly), it does not
  66        add `subdir/git-foo.sh` to the index.
  67
  68See Also
  69--------
  70gitlink:git-rm[1]
  71
  72Author
  73------
  74Written by Linus Torvalds <torvalds@osdl.org>
  75
  76Documentation
  77--------------
  78Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
  79
  80GIT
  81---
  82Part of the gitlink:git[7] suite
  83