summaryrefslogtreecommitdiff
path: root/Documentation/git-rm.txt
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2013-09-30 15:08:10 +0100
committerJonathan Maw <jonathan.maw@codethink.co.uk>2013-09-30 15:08:10 +0100
commit43efcf42382e87de4aa423e5e1607958ad1717d0 (patch)
tree7e19a0765b0dd6885fbdf69d3a8d0159a1b42de8 /Documentation/git-rm.txt
parent45d74c4b0fe38218b4569a90da7102cf48d616c2 (diff)
parentc7fd06b6411fb04eb4d9acd7f8822a288a50dc17 (diff)
downloadgit-43efcf42382e87de4aa423e5e1607958ad1717d0.tar.gz
Merge branch 'baserock/jonathanmaw/S9007/upgrade-git' into baserock/morphbaserock/morph
Reviewed-by: Lars Wirzenius <lars.wirzenius@codethink.co.uk> Reviewed-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
Diffstat (limited to 'Documentation/git-rm.txt')
-rw-r--r--Documentation/git-rm.txt30
1 files changed, 24 insertions, 6 deletions
diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt
index 665ad4ddab..1d876c2619 100644
--- a/Documentation/git-rm.txt
+++ b/Documentation/git-rm.txt
@@ -28,7 +28,7 @@ OPTIONS
-------
<file>...::
Files to remove. Fileglobs (e.g. `*.c`) can be given to
- remove all matching files. If you want git to expand
+ remove all matching files. If you want Git to expand
file glob characters, you may need to shell-escape them.
A leading directory name
(e.g. `dir` to remove `dir/file1` and `dir/file2`) can be
@@ -74,13 +74,12 @@ DISCUSSION
The <file> list given to the command can be exact pathnames,
file glob patterns, or leading directory names. The command
-removes only the paths that are known to git. Giving the name of
-a file that you have not told git about does not remove that file.
+removes only the paths that are known to Git. Giving the name of
+a file that you have not told Git about does not remove that file.
File globbing matches across directory boundaries. Thus, given
two directories `d` and `d2`, there is a difference between
-using `git rm {apostrophe}d{asterisk}{apostrophe}` and
-`git rm {apostrophe}d/{asterisk}{apostrophe}`, as the former will
+using `git rm 'd*'` and `git rm 'd/*'`, as the former will
also remove all of directory `d2`.
REMOVING FILES THAT HAVE DISAPPEARED FROM THE FILESYSTEM
@@ -135,6 +134,25 @@ use the following command:
git diff --name-only --diff-filter=D -z | xargs -0 git rm --cached
----------------
+Submodules
+~~~~~~~~~~
+Only submodules using a gitfile (which means they were cloned
+with a Git version 1.7.8 or newer) will be removed from the work
+tree, as their repository lives inside the .git directory of the
+superproject. If a submodule (or one of those nested inside it)
+still uses a .git directory, `git rm` will fail - no matter if forced
+or not - to protect the submodule's history.
+
+A submodule is considered up-to-date when the HEAD is the same as
+recorded in the index, no tracked files are modified and no untracked
+files that aren't ignored are present in the submodules work tree.
+Ignored files are deemed expendable and won't stop a submodule's work
+tree from being removed.
+
+If you only want to remove the local checkout of a submodule from your
+work tree without committing the removal,
+use linkgit:git-submodule[1] `deinit` instead.
+
EXAMPLES
--------
`git rm Documentation/\*.txt`::
@@ -142,7 +160,7 @@ EXAMPLES
`Documentation` directory and any of its subdirectories.
+
Note that the asterisk `*` is quoted from the shell in this
-example; this lets git, and not the shell, expand the pathnames
+example; this lets Git, and not the shell, expand the pathnames
of files and subdirectories under the `Documentation/` directory.
`git rm -f git-*.sh`::