multiple git repositories in a single Eclipse project? [message #1736170] |
Mon, 27 June 2016 09:14 |
Horacio Anton Quiles Messages: 12 Registered: June 2016 |
Junior Member |
|
|
Hello,
I have an Eclipse (CDT) project which contains multiple git repositories. The project's root directory is a git repository itself; various subdirectories also contain their own repositories.
Eclipse easily connects to the root git repository, but I have been unable to find a way to make Eclipse realize that the subdirectories correspond to different repositories.
Is there a way to do it?
If not, why? Is it just not implemented? Or maybe it can't be done because of an EGit limitation, or a limitation in the Eclipse Team Provider infrastructure? (I'm assuming that this kind of thing should be transparent to JGit, just as it is to the native git). Should I open a bug report/feature request? (if so, where? in EGit's tracker?)
And, can anyone propose an alternative? For example, I have tried keeping each repository in its own project, and use the project's properties to exclude the subdirectories in the root project while making it depend from the "subprojects" - but it's messy, and still, the whole project gets built by a single makefile, so the non-root projects have their indexing messed up because of their lack of access to the build console output.
I have seen mentions of using git submodules to make this kind of repository nesting explicit at the git level. But submodules seem to have their own problems, which is the reason why I am not using them already outside of Eclipse; so I would prefer avoiding them.
Any hint will be welcome. Thanks!
|
|
|
|
|
|
Re: multiple git repositories in a single Eclipse project? [message #1769544 is a reply to message #1736170] |
Tue, 01 August 2017 12:50 |
Horacio Anton Quiles Messages: 12 Registered: June 2016 |
Junior Member |
|
|
One year later (and after some months not using Eclipse), I am back at trying to make Eclipse find the independent git repos in subfolders of a project.
I'd swear this is the same situation I had when I started this thread, which got solved by EGit 4.4 in Eclipse Neon. But now it doesn't seem to work; Team/Share project only offers to use/create a git repo in the root dir of the project.
The only explanation I can find is that I updated Eclipse Neon to .3 and maybe something broke. Eclipse Oxygen works the same.
So: does anyone know if the support for nested folders with repos got removed or some such?
(I already checked the release notes for EGit, and only an improvement is mentioned regarding nested repositories; nothing is said about removal of the feature)
[Updated on: Tue, 01 August 2017 12:52] Report message to a moderator
|
|
|
|
Re: multiple git repositories in a single Eclipse project? [message #1769853 is a reply to message #1769711] |
Fri, 04 August 2017 08:41 |
Horacio Anton Quiles Messages: 12 Registered: June 2016 |
Junior Member |
|
|
I have found a workaround for my problem, and probably for yours.
My problem is very specific: I already had those repos-in-subdirs detected earlier, and somehow they disappeared. I suspect, but am not sure, that this happened when upgrading Eclipse (Neon.x -> Neon.3 or Neon.3->Oxygen).
And the workaround I have found is to delete the project from the Eclipse workspace (be careful not to delete it from the disk) and just re-adding it, by using the "Makefile project with existing code" wizard. And suddenly all the repos were again there.
Now, my case was probably lucky because my project's root directory *also* contains a git repository, so using Team/Share project seemingly fell into the use case in which everything works automatically: the root git project gets detected by Eclipse, *and* the repos-in-subdirs also get automatically detected.
The rub is that, as far as I can tell, you totally depend on the automatic detection, since I don't see any way to have them explicitly detected. So in my original problem, when they just stopped being shown, the only workaround was to remove and readd the project.
So, for your case: I'd suggest you create an empty git repo in your project's root directory (maybe by just accepting the suggestion by the Team/Share project wizard), and see if those repos-in-subdirs get detected.
Good luck! (and if you let me know how it goes I will try opening a bug report for EGit...)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04527 seconds