Tyler
Tyler

Reputation: 303

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?

Upvotes: 5

Views: 3849

Answers (2)

VonC
VonC

Reputation: 1328562

Note that starting Git 2.40 (Q1 2023), you will be able to display more information with the verbose mode:

git submodule -v status

And you can remove the submodule TestLibrary1 from your local Git config with:

git config --unset-all submodule.TestLibrary1

This is safer than editing the .git/config by hand.

Upvotes: 1

Talkhak1313
Talkhak1313

Reputation: 369

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.

Upvotes: 7

Related Questions