summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2012-10-29 04:12:07 -0400
committerLibravatar Jeff King <peff@peff.net>2012-10-29 04:12:07 -0400
commitd21240fafafdea4fb4cab27c0e9b58ebad7d6172 (patch)
tree834ae033a8df4979709fd58a72f08d9ab7a21e8d /Documentation
parentMerge branch 'jk/strbuf-detach-always-non-null' (diff)
parentsubmodule: teach rm to remove submodules unless they contain a git directory (diff)
downloadtgif-d21240fafafdea4fb4cab27c0e9b58ebad7d6172.tar.xz
Merge branch 'jl/submodule-rm'
"git rm submodule" cannot blindly remove a submodule directory as its working tree may have local changes, and worse yet, it may even have its repository embedded in it. Teach it some special cases where it is safe to remove a submodule, specifically, when there is no local changes in the submodule working tree, and its repository is not embedded in its working tree but is elsewhere and uses the gitfile mechanism to point at it. * jl/submodule-rm: submodule: teach rm to remove submodules unless they contain a git directory
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-rm.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt
index 5d31860eb1..882cb1171b 100644
--- a/Documentation/git-rm.txt
+++ b/Documentation/git-rm.txt
@@ -107,6 +107,21 @@ as well as modifications of existing paths.
Typically you would first remove all tracked files from the working
tree using this command:
+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.
+
----------------
git ls-files -z | xargs -0 rm -f
----------------