I'm using git submodule and git submodule update --init --recursive
command is slow (8 sec) although there seems no changes to be updated.
I want to debug why it's slow but it seems there is no --verbose
switch. Any idea to debug what it's doing?
I'm running Ubuntu 14.04 and Git 1.9.
The git submodule update command sets the Git repository of the submodule to that particular commit. The submodule repository tracks its own content which is nested into the main repository. The main repository refers to a commit of the nested submodule repository.
It means the same as with a non-submodule: "dirty" means the index differs from HEAD and/or the work-tree differs from the index. Each submodule is its own repository, so to test if a submodule is dirty, "cd" into the submodule and test whether the repository is dirty.
Git submodules may look powerful or cool upfront, but for all the reasons above it is a bad idea to share code using submodules, especially when the code changes frequently. It will be much worse when you have more and more developers working on the same repos.
Since there is no change to actually checkout and copy, that leaves two main root causes:
git submodule update
was optimized since the old git 1.9: see if the issue persists with the latest git 2.6.4 found in the launchpad ppa
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