6
git-add - Add file contents to the changeset to be committed next
6
git-add - Add file contents to the index
10
'git-add' [-n] [-v] [-f] [--interactive | -i] [-u] [--] <file>...
11
'git-add' [-n] [-v] [-f] [--interactive | -i] [-u] [--refresh]
14
All the changed file contents to be committed together in a single set
15
of changes must be "added" with the 'add' command before using the
16
'commit' command. This is not only for adding new files. Even modified
17
files must be added to the set of changes about to be committed.
19
This command can be performed multiple times before a commit. The added
20
content corresponds to the state of specified file(s) at the time the
21
'add' command is used. This means the 'commit' command will not consider
22
subsequent changes to already added content if it is not added again before
25
The 'git status' command can be used to obtain a summary of what is included
28
This command can be used to add ignored files with `-f` (force)
29
option, but they have to be
30
explicitly and exactly specified from the command line. File globbing
31
and recursive behaviour do not add ignored files.
16
This command adds the current content of new or modified files to the
17
index, thus staging that content for inclusion in the next commit.
19
The "index" holds a snapshot of the content of the working tree, and it
20
is this snapshot that is taken as the contents of the next commit. Thus
21
after making any changes to the working directory, and before running
22
the commit command, you must use the 'add' command to add any new or
23
modified files to the index.
25
This command can be performed multiple times before a commit. It only
26
adds the content of the specified file(s) at the time the add command is
27
run; if you want subsequent changes included in the next commit, then
28
you must run 'git add' again to add the new content to the index.
30
The 'git status' command can be used to obtain a summary of which
31
files have changes that are staged for the next commit.
33
The 'git add' command will not add ignored files by default. If any
34
ignored files were explicitly specified on the command line, 'git add'
35
will fail with a list of ignored files. Ignored files reached by
36
directory recursion or filename globbing performed by Git (quote your
37
globs before the shell) will be silently ignored. The 'add' command can
38
be used to add ignored files with the `-f` (force) option.
33
40
Please see gitlink:git-commit[1] for alternative ways to add content to a
63
70
command line. If no paths are specified, all tracked files are
74
Don't add the file(s), but only refresh their stat()
75
information in the index.
67
78
This option can be used to separate command-line options from
68
79
the list of files, (useful when filenames might be mistaken