Search code examples
gitgit-submodules

Unable to update git sub-modules


In my project, i am using sub-modules to manage the dependencies.

I ran the command once and the repos are cloned and fetched.

git submodule update --init --recursive

Now, I have deleted the folder (_internals) in which they were cloned.

when running the command again, it does not fetch anything.

Not Sure whats wrong. Any pointers or help ?


Solution

  • I hope you have not gone through this answer

    To Quote it:

    git pull --recurse-submodules --jobs=10
    
    **a feature git first learned in 1.8.5.**
    

    Until the bug is fixed, for the first time you do need to run

    git submodule update --init --recursive
    
    

    Or try running:

    git pull --recurse-submodules
    

    Can you try this: Move into the submodule's directory, then do a git reset --hard to reset all modified files to their last committed state. Be aware that this will discard all non-committed changes. From https://stackoverflow.com/a/10906596/6517383