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