Autogenerated man pages for 026351a03507dc3a2e89e068c01234dc55914df2
[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 git\-add [\-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 .SH "DISCUSSION"
48
49
50 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:
51
52 .TP 3
53 1.
54 You can put the name of a directory on the command line, and the command will add all files in it and its subdirectories;
55 .TP
56 2.
57 Giving the name of a file that is already in index does not run git\-update\-index on that path\&.
58 .LP
59
60 .SH "EXAMPLES"
61
62 .TP
63 git\-add Documentation/\\*\&.txt
64 Adds all *\&.txt files that are not in the index under Documentation directory and its subdirectories\&.
65
66 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\&.
67
68 .TP
69 git\-add git\-*\&.sh
70 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\&.
71
72 .SH "AUTHOR"
73
74
75 Written by Linus Torvalds <torvalds@osdl\&.org>
76
77 .SH "DOCUMENTATION"
78
79
80 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
81
82 .SH "GIT"
83
84
85 Part of the \fBgit\fR(7) suite
86