Autogenerated man pages for v1.2.4-gce5b6
[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 .SH "OPTIONS"
34
35 .TP
36 <file>...
37 Files to add to the index\&.
38
39 .TP
40 \-n
41 Don't actually add the file(s), just show if they exist\&.
42
43 .TP
44 \-v
45 Be verbose\&.
46
47 .TP
48 --
49 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)\&.
50
51 .SH "DISCUSSION"
52
53
54 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:
55
56 .TP 3
57 1.
58 You can put the name of a directory on the command line, and the command will add all files in it and its subdirectories;
59 .TP
60 2.
61 Giving the name of a file that is already in index does not run git\-update\-index on that path\&.
62 .LP
63
64 .SH "EXAMPLES"
65
66 .TP
67 git\-add Documentation/\\*\&.txt
68 Adds all *\&.txt files that are not in the index under Documentation directory and its subdirectories\&.
69
70 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\&.
71
72 .TP
73 git\-add git\-*\&.sh
74 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\&.
75
76 .SH "SEE ALSO"
77
78
79 \fBgit\-rm\fR(1)
80
81 .SH "AUTHOR"
82
83
84 Written by Linus Torvalds <torvalds@osdl\&.org>
85
86 .SH "DOCUMENTATION"
87
88
89 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
90
91 .SH "GIT"
92
93
94 Part of the \fBgit\fR(7) suite
95