Git checkout problems after removing submodule in branch
Hi,
we experience some problems on our teamcity setup. The Git repository of a specific project contains submodules. In one of the latest checkins, a submodule was removed from .gitmodules in a specific branch. The master still have the submodule included. Teamcity is not able to checkout the code anymore and shows errors:
Error collecting changes for VCS repository '"Repository" {instance id=123, parent internal id=5, parent id=ProjectID, description: "URL.to.Git#master"}'
Collecting changes failed: jetbrains.buildServer.buildTriggers.vcs.git.submodules.MissingSubmoduleEntryException: The repository 'URL.to.Git' has a submodule in the 'c79c4973cf340e83467ab6fb6c9569ae435cc0fc' commit at the 'deps/submodule' path, but has no entry for this path in .gitmodules configuration
How is it possible that it still tries to checkout a submodule in deps/submodule even if this doesn't exist anymore in the .gitmodules file. And how can I solve this problem? I tried to clear cache and deleted all the folders already. It always creates this folder in the working directory.
Please sign in to leave a comment.
For future reference, in case someone ends up checking this topic, Frank already opened an issue in our tracker where it was answered by the dev: https://youtrack.jetbrains.com/issue/TW-55693
We encountered a similar error due to removing a submodule.
In our case the solution was to add a newline at the end of the .gitmodules file(it was empty after the removal of a submodule, and having 1 newline in the file seems to have removed the teamcity error)
Wow, a new (second) empty line in gitodules fixed this!