Autogenerated man pages for v1.3.3-ged90
[git.git] / man1 / git-add.1
1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2 .de Sh \" Subsection
3 .br
4 .if t .Sp
5 .ne 5
6 .PP
7 \fB\\$1\fR
8 .PP
9 ..
10 .de Sp \" Vertical space (when we can't use .PP)
11 .if t .sp .5v
12 .if n .sp
13 ..
14 .de Ip \" List item
15 .br
16 .ie \\n(.$>=3 .ne \\$3
17 .el .ne 3
18 .IP "\\$1" \\$2
19 ..
20 .TH "GIT-ADD" 1 "" "" ""
21 .SH NAME
22 git-add \- Add files to the index file
23 .SH "SYNOPSIS"
24
25
26 \fIgit\-add\fR [\-n] [\-v] [\-\-] <file>...
27
28 .SH "DESCRIPTION"
29
30
31 A simple wrapper for git\-update\-index to add files to the index, for people used to do "cvs add"\&.
32
33
34 It only adds non\-ignored files, to add ignored files use "git update\-index \-\-add"\&.
35
36 .SH "OPTIONS"
37
38 .TP
39 <file>...
40 Files to add to the index (see \fBgit\-ls\-files\fR(1))\&.
41
42 .TP
43 \-n
44 Don't actually add the file(s), just show if they exist\&.
45
46 .TP
47 \-v
48 Be verbose\&.
49
50 .TP
51 \-\-
52 This option can be used to separate command\-line options from the list of files, (useful when filenames might be mistaken for command\-line options)\&.
53
54 .SH "DISCUSSION"
55
56
57 The list of <file> given to the command is fed to git\-ls\-files command to list files that are not registered in the index and are not ignored/excluded by $GIT_DIR/info/exclude file or \&.gitignore file in each directory\&. This means two things:
58
59 .TP 3
60 1.
61 You can put the name of a directory on the command line, and the command will add all files in it and its subdirectories;
62 .TP
63 2.
64 Giving the name of a file that is already in index does not run git\-update\-index on that path\&.
65 .LP
66
67 .SH "EXAMPLES"
68
69 .TP
70 git\-add Documentation/\\*\&.txt
71 Adds all *\&.txt files that are not in the index under Documentation directory and its subdirectories\&.
72
73 Note that the asterisk * is quoted from the shell in this example; this lets the command to include the files from subdirectories of Documentation/ directory\&.
74
75 .TP
76 git\-add git\-*\&.sh
77 Adds all git\-*\&.sh scripts that are not in the index\&. Because this example lets shell expand the asterisk (i\&.e\&. you are listing the files explicitly), it does not add subdir/git\-foo\&.sh to the index\&.
78
79 .SH "SEE ALSO"
80
81
82 \fBgit\-rm\fR(1) \fBgit\-ls\-files\fR(1)
83
84 .SH "AUTHOR"
85
86
87 Written by Linus Torvalds <torvalds@osdl\&.org>
88
89 .SH "DOCUMENTATION"
90
91
92 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
93
94 .SH "GIT"
95
96
97 Part of the \fBgit\fR(7) suite
98