Eclipse Workspace directory and ".git" directory [message #1816959] |
Tue, 12 November 2019 17:59  |
Eclipse User |
|
|
|
Hi,
Is it proper to have ".git" directory under Eclipse workspace directory or under respective projects directories? I ended up with two ".git" directories, each under respective project (see below):
Working directory (Eclipse workspace)
|
|-.metadata
|
|--Project1
| |-- .git
| |-- .classpath
| |-- .project
| |-- ....
|
|--Project2
| |-- .git
| |-- .classpath
| |-- .project
| |-- ....
My Git remote repository looks like this:
# ls -l /var/lib/git
total 8
drwxr-xr-x 8 luser luser 4096 Nov 9 07:26 Project1.git
drwxr-xr-x 8 luser luser 4096 Sep 12 16:20 Project2.git
My setup appears to contradict the documentation ( see https://wiki.eclipse.org/EGit/User_Guide#The_longer_story. ) but it does work.
Any ideas? Potential problems? Thanks
[Updated on: Wed, 13 November 2019 08:12] by Moderator
|
|
|
|
|
|
|
Re: Eclipse Workspace directory and ".git" directory [message #1817016 is a reply to message #1817014] |
Thu, 14 November 2019 00:01   |
Eclipse User |
|
|
|
Yes, it makes sense to put unrelated things in separate clones.
I see each of your projects has a .classpath file so I assume each is a Java project. It seems to me only the most trivial Java software is ever developed as a single project. Given you've made the root folder of the clone itself a project you'll never be able to add another project to the clone as your software grows in complexity. Well, technically you can, but there's no such concept as a nested Eclipse project, so you'd end up with something that doesn't fit well with the workspace concept of a project, i.e., you'll end up with a project that has a folder that is also itself a project so you'll see the same files twice in the workspace unless from the context menu you use Properties... -> Resource -> Resource Filters... to hide subfolders of a project from the workspace's view of that project, i.e., you could use that to hide the .git folder so that you don't accidentally edit it directly and so that the workspace doesn't index it or need to synchronize the state of the entire clone representation as part of the workspace's state.
It seems to me that you'd likely be better off with the project being a subfolder in the clone; then you could more easily add, for example, a JUnit project, or refactor the project into small related parts.
|
|
|
|
|
|
|
|
Re: Eclipse Workspace directory and ".git" directory [message #1817171 is a reply to message #1817143] |
Sun, 17 November 2019 14:26  |
Eclipse User |
|
|
|
I just run into an odd "problem" - after I "import" from local repository , the project behaves OK until I add a plain C/C++ test project.
Then doing "Build -> Settings " on such test project works only once.
I ended up with "Eclipse_CDT" and "Eclipse_CDT_TCF_EGIT" folders and corresponding workspace folders.
For "ease of navigation" I could put them as sub folders of some common folder.
Similar to your cases of multiple local repositories.
From past experiences with different versions of Eclipse I prefer to be "disorganized " and keep functional folders separate.
When Eclipse goes to next version /release I will put all current v ersion under common folder then copy them to archive.
I am little paranoid of loosing stuff, been there , done that.
Cheers
|
|
|
Powered by
FUDForum. Page generated in 0.06586 seconds