</div>\r
<h2>SYNOPSIS</h2>\r
<div class="sectionbody">\r
-<p><em>git-add</em> [-n] [-v] [--interactive] [--] <file>…</p>\r
+<p><em>git-add</em> [-n] [-v] [-f] [--interactive] [--] <file>…</p>\r
</div>\r
<h2>DESCRIPTION</h2>\r
<div class="sectionbody">\r
the commit.</p>\r
<p>The <em>git status</em> command can be used to obtain a summary of what is included\r
for the next commit.</p>\r
-<p>This command only adds non-ignored files, to add ignored files use\r
-"git update-index --add".</p>\r
+<p>This command can be used to add ignored files with <tt>-f</tt> (force)\r
+option, but they have to be\r
+explicitly and exactly specified from the command line. File globbing\r
+and recursive behaviour do not add ignored files.</p>\r
<p>Please see <a href="git-commit.html">git-commit(1)</a> for alternative ways to add content to a\r
commit.</p>\r
</div>\r
</dt>\r
<dd>\r
<p>\r
- Files to add content from.\r
+ Files to add content from. Fileglobs (e.g. <tt>*.c</tt>) can\r
+ be given to add all matching files. Also a\r
+ leading directory name (e.g. <tt>dir</tt> to add <tt>dir/file1</tt>\r
+ and <tt>dir/file2</tt>) can be given to add all files in the\r
+ directory, recursively.\r
</p>\r
</dd>\r
<dt>\r
</p>\r
</dd>\r
<dt>\r
+-f\r
+</dt>\r
+<dd>\r
+<p>\r
+ Allow adding otherwise ignored files.\r
+</p>\r
+</dd>\r
+<dt>\r
--interactive\r
</dt>\r
<dd>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 25-Dec-2006 11:36:05 UTC\r
+Last updated 26-Dec-2006 03:21:38 UTC\r
</div>\r
</div>\r
</body>\r
SYNOPSIS
--------
-'git-add' [-n] [-v] [--interactive] [--] <file>...
+'git-add' [-n] [-v] [-f] [--interactive] [--] <file>...
DESCRIPTION
-----------
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
-"git update-index --add".
+This command can be used to add ignored files with `-f` (force)
+option, but they have to be
+explicitly and exactly specified from the command line. File globbing
+and recursive behaviour do not add ignored files.
Please see gitlink:git-commit[1] for alternative ways to add content to a
commit.
OPTIONS
-------
<file>...::
- Files to add content from.
+ Files to add content from. Fileglobs (e.g. `*.c`) can
+ be given to add all matching files. Also a
+ leading directory name (e.g. `dir` to add `dir/file1`
+ and `dir/file2`) can be given to add all files in the
+ directory, recursively.
-n::
Don't actually add the file(s), just show if they exist.
-v::
Be verbose.
+-f::
+ Allow adding otherwise ignored files.
+
\--interactive::
Add modified contents in the working tree interactively to
the index.
</div>\r
<h2>SYNOPSIS</h2>\r
<div class="sectionbody">\r
-<p><em>git-rm</em> [-f] [-n] [-v] [--] <file>…</p>\r
+<p><em>git-rm</em> [-f] [-n] [-r] [--cached] [--] <file>…</p>\r
</div>\r
<h2>DESCRIPTION</h2>\r
<div class="sectionbody">\r
-<p>A convenience wrapper for git-update-index --remove. For those coming\r
-from cvs, git-rm provides an operation similar to "cvs rm" or "cvs\r
-remove".</p>\r
+<p>Remove files from the working tree and from the index. The\r
+files have to be identical to the tip of the branch, and no\r
+updates to its contents must have been placed in the staging\r
+area (aka index).</p>\r
</div>\r
<h2>OPTIONS</h2>\r
<div class="sectionbody">\r
</dt>\r
<dd>\r
<p>\r
- Files to remove from the index and optionally, from the\r
- working tree as well.\r
+ Files to remove. Fileglobs (e.g. <tt>*.c</tt>) can be given to\r
+ remove all matching files. Also a leading directory name\r
+ (e.g. <tt>dir</tt> to add <tt>dir/file1</tt> and <tt>dir/file2</tt>) can be\r
+ given to remove all files in the directory, recursively,\r
+ but this requires <tt>-r</tt> option to be given for safety.\r
</p>\r
</dd>\r
<dt>\r
</dt>\r
<dd>\r
<p>\r
- Remove files from the working tree as well as from the index.\r
+ Override the up-to-date check.\r
</p>\r
</dd>\r
<dt>\r
</p>\r
</dd>\r
<dt>\r
--v\r
+-r\r
</dt>\r
<dd>\r
<p>\r
- Be verbose.\r
+ Allow recursive removal when a leading directory name is\r
+ given.\r
</p>\r
</dd>\r
<dt>\r
for command-line options).\r
</p>\r
</dd>\r
+<dt>\r
+--cached\r
+</dt>\r
+<dd>\r
+<p>\r
+ This option can be used to tell the command to remove\r
+ the paths only from the index, leaving working tree\r
+ files.\r
+</p>\r
+</dd>\r
</dl>\r
</div>\r
<h2>DISCUSSION</h2>\r
<div class="sectionbody">\r
-<p>The list of <file> given to the command is fed to <tt>git-ls-files</tt>\r
-command to list files that are registered in the index and\r
-are not ignored/excluded by <tt>$GIT_DIR/info/exclude</tt> file or\r
-<tt>.gitignore</tt> file in each directory. This means two things:</p>\r
-<ol>\r
-<li>\r
-<p>\r
-You can put the name of a directory on the command line, and the\r
- command will remove all files in it and its subdirectories (the\r
- directories themselves are never removed from the working tree);\r
-</p>\r
-</li>\r
-<li>\r
-<p>\r
-Giving the name of a file that is not in the index does not\r
- remove that file.\r
-</p>\r
-</li>\r
-</ol>\r
+<p>The list of <file> given to the command can be exact pathnames,\r
+file glob patterns, or leading directory name. The command\r
+removes only the paths that is known to git. Giving the name of\r
+a file that you have not told git about does not remove that file.</p>\r
</div>\r
<h2>EXAMPLES</h2>\r
<div class="sectionbody">\r
<dd>\r
<p>\r
Remove all git-*.sh scripts that are in the index. The files\r
- are removed from the index, and (because of the -f option),\r
- from the working tree as well. Because this example lets the\r
- shell expand the asterisk (i.e. you are listing the files\r
- explicitly), it does not remove <tt>subdir/git-foo.sh</tt>.\r
+ are removed from the index, and from the working\r
+ tree. Because this example lets the shell expand the\r
+ asterisk (i.e. you are listing the files explicitly), it\r
+ does not remove <tt>subdir/git-foo.sh</tt>.\r
</p>\r
</dd>\r
</dl>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 03-Oct-2006 08:41:26 UTC\r
+Last updated 26-Dec-2006 03:21:38 UTC\r
</div>\r
</div>\r
</body>\r
SYNOPSIS
--------
-'git-rm' [-f] [-n] [-v] [--] <file>...
+'git-rm' [-f] [-n] [-r] [--cached] [--] <file>...
DESCRIPTION
-----------
-A convenience wrapper for git-update-index --remove. For those coming
-from cvs, git-rm provides an operation similar to "cvs rm" or "cvs
-remove".
+Remove files from the working tree and from the index. The
+files have to be identical to the tip of the branch, and no
+updates to its contents must have been placed in the staging
+area (aka index).
OPTIONS
-------
<file>...::
- Files to remove from the index and optionally, from the
- working tree as well.
+ Files to remove. Fileglobs (e.g. `*.c`) can be given to
+ remove all matching files. Also a leading directory name
+ (e.g. `dir` to add `dir/file1` and `dir/file2`) can be
+ given to remove all files in the directory, recursively,
+ but this requires `-r` option to be given for safety.
-f::
- Remove files from the working tree as well as from the index.
+ Override the up-to-date check.
-n::
Don't actually remove the file(s), just show if they exist in
the index.
--v::
- Be verbose.
+-r::
+ Allow recursive removal when a leading directory name is
+ given.
\--::
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).
+\--cached::
+ This option can be used to tell the command to remove
+ the paths only from the index, leaving working tree
+ files.
+
DISCUSSION
----------
-The list of <file> given to the command is fed to `git-ls-files`
-command to list files that are 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:
-
-. You can put the name of a directory on the command line, and the
- command will remove all files in it and its subdirectories (the
- directories themselves are never removed from the working tree);
-
-. Giving the name of a file that is not in the index does not
- remove that file.
+The list of <file> given to the command can be exact pathnames,
+file glob patterns, or leading directory name. The command
+removes only the paths that is known to git. Giving the name of
+a file that you have not told git about does not remove that file.
EXAMPLES
git-rm -f git-*.sh::
Remove all git-*.sh scripts that are in the index. The files
- are removed from the index, and (because of the -f option),
- from the working tree as well. Because this example lets the
- shell expand the asterisk (i.e. you are listing the files
- explicitly), it does not remove `subdir/git-foo.sh`.
+ are removed from the index, and from the working
+ tree. Because this example lets the shell expand the
+ asterisk (i.e. you are listing the files explicitly), it
+ does not remove `subdir/git-foo.sh`.
See Also
--------