Confused about repository with git submodule [message #1860348] |
Mon, 31 July 2023 13:29  |
Eclipse User |
|
|
|
This is probably a git question, but I'll try asking it here.
Using Eclipse 2023-06.
I have many repositories cloned to my desktop from egit. Several of them have a ".gitmodules" file. In fact, they all have the SAME .gitmodules file, linking to the same repository. All of those existing repositories that I had cloned a while ago look fine. I can see the submodule data in the file system. In the "Git Repositories" view, I can open up the "Submodules" node and it shows the correct folder.
One clarification on the .gitmodules file. By default, what I get when I clone the main repository is a .gitmodules file with a "relative" url. I've had some trouble using relative urls in the past, so I change it to an absolute url. In the several repositories where this submodule is still working, some of them still have the relative url, and some have the absolute url.
Today I updated a repository I had cloned a while ago, and I see that the submodule directory is empty. It has the same .gitmodules file as the others. In the Git Repositories view, the "Submodules" node is empty. If I try to "Sync" it, it does nothing. If I try to "Update" it, it chugs for a couple seconds and then presents a dialog with fields "Repository", "User", "Password", and "Store in Secure Store" fields.
I tried to change the .gitmodules file to the absolute url form, and it made no difference.
I already have the repository referenced in the submodule cloned to my desktop. I use SSH authentication for all of my repositories, including this one.
|
|
|
Re: Confused about repository with git submodule [message #1860355 is a reply to message #1860348] |
Mon, 31 July 2023 18:14   |
Eclipse User |
|
|
|
Curiously, the symptom has changed slightly, perhaps even worse. Now, when I select "Update", it simply draws the ">" on the "Submodules" line, which stays there for a moment, and then goes away. It doesn't even bring up the user/password dialog anymore.
I'm now trying to simply delete the project and repository and reclone it, and that isn't working either. I'm checking "Clone submodules". the clone eventually fails with "invalid remote: origin".
I then simply went to my shell and went to another directory and ran:
git clone --recurse-submodules ssh://git@.../reponame.git reponame
Which as far as I can tell, is the exact command-line version of what I was trying to do from egit. This WORKED. This will do for a workaround, but I don't want to have to run to the command line every time I have to clone a repo with a submodule. I'll go create an issue if no one has an idea on this.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04744 seconds