~ubuntu-branches/ubuntu/intrepid/git-core/intrepid-security

« back to all changes in this revision

Viewing changes to Documentation/git-add.txt

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-10-04 08:27:01 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20071004082701-rsd058ontoqz4i30
Tags: 1:1.5.3.4-1
new upstream point release (closes: #445188).

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
NAME
5
5
----
6
 
git-add - Add file contents to the changeset to be committed next
 
6
git-add - Add file contents to the index
7
7
 
8
8
SYNOPSIS
9
9
--------
10
 
'git-add' [-n] [-v] [-f] [--interactive | -i] [-u] [--] <file>...
 
10
[verse]
 
11
'git-add' [-n] [-v] [-f] [--interactive | -i] [-u] [--refresh]
 
12
          [--] <filepattern>...
11
13
 
12
14
DESCRIPTION
13
15
-----------
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.
18
 
 
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
23
 
the commit.
24
 
 
25
 
The 'git status' command can be used to obtain a summary of what is included
26
 
for the next commit.
27
 
 
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.
 
18
 
 
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.
 
24
 
 
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.
 
29
 
 
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.
 
32
 
 
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.
32
39
 
33
40
Please see gitlink:git-commit[1] for alternative ways to add content to a
34
41
commit.
36
43
 
37
44
OPTIONS
38
45
-------
39
 
<file>...::
 
46
<filepattern>...::
40
47
        Files to add content from.  Fileglobs (e.g. `*.c`) can
41
48
        be given to add all matching files.  Also a
42
49
        leading directory name (e.g. `dir` to add `dir/file1`
63
70
        command line. If no paths are specified, all tracked files are
64
71
        updated.
65
72
 
 
73
\--refresh::
 
74
        Don't add the file(s), but only refresh their stat()
 
75
        information in the index.
 
76
 
66
77
\--::
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
228
239
GIT
229
240
---
230
241
Part of the gitlink:git[7] suite
231