It is an old entry but..
I had the same bash-prompt today. I was playing with submodules: removing renaming etc. directly in the .gitmodule file, where all submodules are listed. (I've renamed the origin paths manually and renamed the git project on the gitlab server, too)
In order to fix this issue, created/renamed back my previous projects again and used the git commands for adding/removing submodules.
Don't forget to create a directory backup first ;)
My system:
Host git vesion 2.47.1, windows 11,
remote: debian 12, git version 2.39.5, gitlab 17.4