Search code examples
gitgithub-actionsgit-submodulesgit-checkout

Why do I get "fatal: No url found for submodule path 'TestLibrary1' in .gitmodules" for a submodule that no longer exists?


Problem

When I try to checkout my repository using GitHub Actions I get the following error:

fatal: No url found for submodule path 'TestLibrary1' in .gitmodules

What I Tried

I tried removing the submodule.

As far as I can tell it is completely gone (it is gone from the folder & from .gitmodules)

However, I keep getting the above error.

Question

Why is this still happening when the submodule no longer exists?

Is there somewhere that it is holding onto a reference that I can check?


Solution

  • The root cause of the issue could be that the old submodule path remains cached based on this.

    check the status of the submodule

    git submodule status
    

    remove the cache using the old/path returns from the previous command

    git rm --cached old/path
    

    try to checkout again and see if the issue is resolved.