Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Confused about repository with git submodule
Confused about repository with git submodule [message #1860348] Mon, 31 July 2023 13:29 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Confused about repository with git submodule [message #1860356 is a reply to message #1860355] Mon, 31 July 2023 18:29 Go to previous messageGo to next message
Eclipse UserFriend
Actually, this still has a problem. It appears I have a problem with line endings (windows box, cloning from linux). I tried adding "-c core.autocrlf=input", but it still thinks that every file has changed, and there are no non-whitespace differences.
Re: Confused about repository with git submodule [message #1860372 is a reply to message #1860356] Tue, 01 August 2023 12:04 Go to previous message
Eclipse UserFriend
I was finally able to clone this with a git command line. The problem with cloning it from egit is repeatable. I'll try to get a ticket created, but I doubt I'll be able to post something that you can just push a button to demonstrate it.
Previous Topic:Unexpected reply from ssh-agent: SSH_AGENT_FAILURE
Next Topic:Why does the New Branch dialog sometimes use the same name as the remote, and sometimes not?
Goto Forum:
  


Current Time: Sat May 17 09:23:39 EDT 2025

Powered by FUDForum. Page generated in 0.04744 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top