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?
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.
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.
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.
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.
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.
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:
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'.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With