Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git submodule update --init --recursive hangs

Tags:

When I type git submodule update --init --recursive in order to recursively cloned submodules, it starts to say cloning... and then proceeds to do nothing... just hangs.

One apparent fix is getting the paths and repos from the .gitmodule files, navigation to the path they prescribe, and git clone them each manually.

Another apparent fix is Cntr-Z to break the action, delete the .git files that are produced by the --init clause, and trying again. It seemly works.

I seem to have a broken result however.

My main question is: is how to get git submodule update --init --recursive working property, without hanging?

Has others come across this before?

like image 775
JohnG79 Avatar asked Aug 22 '17 16:08

JohnG79


People also ask

What is git submodule update -- init -- recursive?

git submodule update --init --recursive --remote - updates all submodules recursively along their tracking branches. Without the --remote , it'll reset the submodule working directories to the "right" commit for the parent.

What does recurse submodules mean?

If you pass --recurse-submodules to the git clone command, it will automatically initialize and update each submodule in the repository, including nested submodules if any of the submodules in the repository have submodules themselves.

What is submodule update?

A git submodule update will bring the latest commits into your local Git worktree. In this git submodule update example, we'll show you how branches can seem out of sync between your submodule and the latest commit, and how to issue the appropriate git command to update those git submodules with the latest code.

Can I push to submodule?

In the parent repo, you can also use git push --recurse-submodules=check which prevents pushing the parent repo if the submodule(s) are not pushed first. Another option is git push --recurse-submodules=on-demand which will try to push the submodules automatically (if necessary) before pushing the parent repo.

How to update submodules recursively in Git?

PHP Git update submodules recursively git submodule update --recursive You will also probably want to use the –init option which will make it initialize any uninitialized submodules: git submodule update --init --recursive Note: in some older versions of Git, if you use the --init option, already-initialized submodules may not be updated.

Why does git pull--recurse-submodules fail when using SuperProject?

In that case, it is possible for git pull --recurse-submodules, or git submodule update, to fail if the superproject references a submodule commit that is not found in the submodule remote locally configured in your repository. In order to remedy this situation, the git submodule sync command is required:

How to have a submodule summary when executing “git status”?

In order to have a submodule summary when executing “git status”, execute the “git config” command and add the “status.submoduleSummary” option. As a consequence, you will be presented with more information when executing “git status” commands. $ git status On branch master Your branch is up-to-date with 'origin/master'.

How do I add a Git submodule to a project?

The first thing you want to do is to add a Git submodule to your main project. In order to add a Git submodule, use the “git submodule add” command and specify the URL of the Git remote repository to be included as a submodule.


1 Answers

By default, updating submodules doesn't show progress. And since many Git repos will have a relatively slow download, this can cause the appearance of hanging (and it's happened to me multiple times).

To make sure this isn't just a case of a large, slow download, run the update command with the --progress option.

git submodule update --init --recursive --progress

like image 151
marknuzz Avatar answered Sep 20 '22 14:09

marknuzz