From cf419828064d4f22a2c3134e7b46a7719462b1dc Mon Sep 17 00:00:00 2001 From: Jens Lehmann Date: Mon, 4 Mar 2013 22:20:24 +0100 Subject: submodule: add 'deinit' command With "git submodule init" the user is able to tell git he cares about one or more submodules and wants to have it populated on the next call to "git submodule update". But currently there is no easy way he could tell git he does not care about a submodule anymore and wants to get rid of his local work tree (except he knows a lot about submodule internals and removes the "submodule.$name.url" setting from .git/config together with the work tree himself). Help those users by providing a 'deinit' command. This removes the whole submodule. section from .git/config (either for the given submodule(s) or for all those which have been initialized if '.' is used) together with their work tree. Fail if the current work tree contains modifications (unless forced), but don't complain when either the work tree is already removed or no settings are found in .git/config. Add tests and link the man pages of "git submodule deinit" and "git rm" to assist the user in deciding whether removing or unregistering the submodule is the right thing to do for him. Also add the deinit subcommand to the completion list. Signed-off-by: Jens Lehmann Signed-off-by: Junio C Hamano --- Documentation/git-rm.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Documentation/git-rm.txt') diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt index 262436b7b1..dbf41621ae 100644 --- a/Documentation/git-rm.txt +++ b/Documentation/git-rm.txt @@ -149,6 +149,10 @@ 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`:: -- cgit v1.2.1