2005-09-08 02:26:23 +02:00
|
|
|
git-add(1)
|
|
|
|
==========
|
2005-08-23 10:49:47 +02:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2006-12-04 17:13:39 +01:00
|
|
|
git-add - Add file contents to the changeset to be committed next
|
2005-08-23 10:49:47 +02:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2006-02-22 00:33:49 +01:00
|
|
|
'git-add' [-n] [-v] [--] <file>...
|
2005-08-23 10:49:47 +02:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2006-12-04 17:13:39 +01:00
|
|
|
All the changed file contents to be committed together in a single set
|
|
|
|
of changes must be "added" with the 'add' command before using the
|
|
|
|
'commit' command. This is not only for adding new files. Even modified
|
|
|
|
files must be added to the set of changes about to be committed.
|
2005-11-04 09:04:17 +01:00
|
|
|
|
2006-12-04 17:13:39 +01:00
|
|
|
This command can be performed multiple times before a commit. The added
|
|
|
|
content corresponds to the state of specified file(s) at the time the
|
|
|
|
'add' command is used. This means the 'commit' command will not consider
|
|
|
|
subsequent changes to already added content if it is not added again before
|
|
|
|
the commit.
|
|
|
|
|
|
|
|
The 'git status' command can be used to obtain a summary of what is included
|
|
|
|
for the next commit.
|
|
|
|
|
|
|
|
This command only adds non-ignored files, to add ignored files use
|
2006-05-19 23:02:34 +02:00
|
|
|
"git update-index --add".
|
2005-08-23 10:49:47 +02:00
|
|
|
|
2006-12-04 17:13:39 +01:00
|
|
|
Please see gitlink:git-commit[1] for alternative ways to add content to a
|
|
|
|
commit.
|
|
|
|
|
|
|
|
|
2005-08-23 10:49:47 +02:00
|
|
|
OPTIONS
|
|
|
|
-------
|
2005-08-27 06:33:46 +02:00
|
|
|
<file>...::
|
2006-12-04 17:13:39 +01:00
|
|
|
Files to add content from.
|
2005-08-23 10:49:47 +02:00
|
|
|
|
2005-10-29 23:46:41 +02:00
|
|
|
-n::
|
|
|
|
Don't actually add the file(s), just show if they exist.
|
|
|
|
|
|
|
|
-v::
|
|
|
|
Be verbose.
|
|
|
|
|
2006-05-05 21:05:24 +02:00
|
|
|
\--::
|
2006-02-22 00:33:49 +01:00
|
|
|
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).
|
|
|
|
|
2005-10-29 23:46:41 +02:00
|
|
|
|
2005-11-04 09:04:17 +01:00
|
|
|
EXAMPLES
|
|
|
|
--------
|
|
|
|
git-add Documentation/\\*.txt::
|
|
|
|
|
2006-12-04 17:13:39 +01:00
|
|
|
Adds content from all `\*.txt` files under `Documentation`
|
|
|
|
directory and its subdirectories.
|
2005-11-04 09:04:17 +01:00
|
|
|
+
|
|
|
|
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.
|
|
|
|
|
|
|
|
git-add git-*.sh::
|
|
|
|
|
2006-12-04 17:13:39 +01:00
|
|
|
Considers adding content from all git-*.sh scripts.
|
2005-11-04 09:04:17 +01:00
|
|
|
Because this example lets shell expand the asterisk
|
|
|
|
(i.e. you are listing the files explicitly), it does not
|
2006-12-04 17:13:39 +01:00
|
|
|
consider `subdir/git-foo.sh`.
|
2005-11-04 09:04:17 +01:00
|
|
|
|
2006-03-05 22:18:19 +01:00
|
|
|
See Also
|
|
|
|
--------
|
2006-12-04 17:13:39 +01:00
|
|
|
gitlink:git-status[1]
|
2006-03-05 22:18:19 +01:00
|
|
|
gitlink:git-rm[1]
|
2006-12-04 17:13:39 +01:00
|
|
|
gitlink:git-mv[1]
|
|
|
|
gitlink:git-commit[1]
|
|
|
|
gitlink:git-update-index[1]
|
2005-11-04 09:04:17 +01:00
|
|
|
|
2005-08-23 10:49:47 +02:00
|
|
|
Author
|
|
|
|
------
|
|
|
|
Written by Linus Torvalds <torvalds@osdl.org>
|
|
|
|
|
|
|
|
Documentation
|
|
|
|
--------------
|
|
|
|
Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
|
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
2005-09-19 12:10:51 +02:00
|
|
|
Part of the gitlink:git[7] suite
|
2005-08-23 10:49:47 +02:00
|
|
|
|