
TRADOS STUDIO 2017 HOW TO REMOVE ACCIDENTAL IMPORT HOW TO
(Merged by Junio C Hamano - gitster - in commit ead8dbe, ) git $ the benefit of the reader, this here tries to sum it up and give a step-by-step guide on how to do it if things do not work as expected. See commit 2e61273, commit 1342476 () by Prathamesh Chavan ( pratham-pc). Note: since Git 2.17 (Q2 2018), git submodule deinit is no longer a shell script. Path 'mysubmodule/file.txt' is in submodule 'mysubmodule' If you forget that last step, and try to add what was a submodule as a regular directory, you would get error message like: git add mysubmodule/file.txt That will remove that directory stored in the index with a special mode "160000", marking it as a submodule root directory. Git rm -cached path_to_submodule (no trailing slash) the submodule special entry (as illustrated by this question): the git rm removes it from the index:.gitmodules file: it is need to removed for you. ' add' step which records the url of a submodule in the.Since git1.8.5, the git rm takes also care of the: This takes care if the (de)initialization steps (. ' is given).įail if the current work tree contains modifications unless forced.Ĭomplain when for a submodule given on the command line the url setting can't be found in. Submodule(s) (or for all those which have been initialized if '.

Help those users by providing a ' deinit' command. git/config together with the work tree himself). With " git submodule init" the user is able to tell git they care about one or more submodules and wants to have it populated on the next call to " git submodule update".īut currently there is no easy way they can tell git they do not care about a submodule anymore and wants to get rid of the local work tree (unless the user knows a lot about submodule internals and removes the " submodule.$name.url" setting from. Git submodule deinit: It stems from this patch: Let " git rm" help the user by not only removing the submodule from the work tree but by also removing the " submodule." section from the. git/config, this must stay as a reminder that the user showed interest in this submodule so it will be repopulated later when an older commit is checked out). gitmodules is left untouched, which is a leftover of the now removed submodule and might irritate users (as opposed to the setting in.

So if you once delete a submodule with this method and re-add them again, it will not be possible because repository already been corrupted.Ĭurrently using " git rm" on a submodule removes the submodule's work tree from that of the superproject and the gitlink from the index.īut the submodule's section in. Rm -rf: This is mentioned in Daniel Schroeder's answer, and summarized by Eonil in the comments: # or, if you want to leave it in your working tree and have done step 0 The 3-steps removal process would then be: 0. The deletion process also uses git rm (since git1.8.5 October 2013). " git submodule deinit" is the way to do so. There was no Porcelain way to say "I no longer am interested in this submodule", once you express your interest in a submodule with " git submodule init".
