
#REMOVING GIT SUBMODULE UPDATE#
If you do not want (or can) update your git, then just use another machine with a newer git! git is meant to be fully distributed, so you can use another git to get the job done: If your machine is too old there is no submodule deinit in your git.

(3) checks out the submodules of the submodule recursively.git submodule update -init -recursive - module.(2) does git submodule update, so, nonrecursively checks out the module.

(1) does git submodule init, so updates.(3) thereby recursively removes the submodules of the submodule.Git submodule update -init -recursive - moduleīecause some commands basically need to do more than just a single thing:

In my understanding this is not only plain wrong, it is extremely dangerous and provokes major headaches in future! See below.Īlso is quite the inverse to git submodule add - URL module It recommends to remove $GIT_DIR/modules// yourself. I think there is a very dangerous part in the documentation of git submodule. Like a proper way to remove submodules again. Stay away at all cost!Īnd yes, you can blame git for this, as many handy things were missing in git in the past.
#REMOVING GIT SUBMODULE WINDOWS#
#REMOVING GIT SUBMODULE HOW TO#
This is regardless of whether you do steps 2 or 3.įor 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. Last but not least, if you don't git commit, you will/may get an error when doing git submodule summary (as of git 2.7): fatal: Not a git repository: 'the_submodule/.git' Submodule from the repository and commit that use git-rm According to the git-submodule documentation, git deinit: I find it more explicit and less confusing to use git config -f. (The entry may cause problems for older git versions, but I don't have one to test).įor this, most answers suggest using git submodule deinit. Step 3 removes the section for the_submodule in the file.

You can probably get away with the above two steps for git 1.8.5+ as tinlyx's answer noted, as all git submodule commands seem to work. git/modules/ for otherwise, you can't e.g. Hopefully, the second part of OP question can be answered positively one day (that this can be done in one command).īut as of July 2017, step 2 is necessary to remove data in. In theory, git rm in step 1 should take care of it. git/config -remove-section submodule.the_submodule Here are the 4 steps that I found necessary or useful (important ones first): git rm -f the_submodule
