Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » How does Eclipse/eGit connect workspace to git repo and its project metadata/source files?(I don't see how an Eclipse/eGit workspace project finds its corresponding source tree)
How does Eclipse/eGit connect workspace to git repo and its project metadata/source files? [message #1744315] Sat, 24 September 2016 22:55 Go to next message
Les Gasser is currently offline Les GasserFriend
Messages: 3
Registered: September 2016
Junior Member
I've been working with Eclipse/eGit and having great success on a number of projects. But there is one piece of information I just can't seem to grasp, hence this query.

If I make an "ordinary" Eclipse project, the default (which I sometimes use) is to place the project source trees into the current workspace directory on the filesystem. Open the workspace and you get access to of the projects residing in the workspace, and it's easy to see how & why that occurs - their code and metadata is right there in the workspace directory structure itself.

But suppose I have an eclipse workspace that contains only git-managed projects with their own local git repos. In that case, as you know, the project source trees will not appear in the eclipse workspace's file structure. Instead, the source trees (along with all project metadata like .project, .classpath, .settings, pom.xml) are stored elsewhere in the filesystem wherever the git repos are, in directories that are "sistered" to their respective .git directories (see attached pic of such a repo & sistered project folder in my main Git directory).

In this kind of git-managed case, the eclipse workspace itself will only contain three directories (see attached pic of such an eclipse workspace):

.metadata
.recommenders
RemoteSystemsTempFiles

I have examined all these, and as far as I can see, there are no project-specific subdirectories or information in the workspace at all. None of these 3 directories or their subfolders or files seem to contain any information about the location or structure of the projects themselves, git repos, metadata, etc.

So when you load this kind of workspace on startup, how does eclipse find information on the projects in the workspace? How does eclipse link the workspace (directory) itself to the repos and the sistered file trees with the actual project metadata, source trees, pom, and so on? How is the connection made?

It must be something obvious (so I think) but I don't find it.

Thanks for any help,

- Les

Re: How does Eclipse/eGit connect workspace to git repo and its project metadata/source files? [message #1744381 is a reply to message #1744315] Mon, 26 September 2016 12:37 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
metadata for Eclipse projects is stored in the workspace folder under
<workspace folder>/.metadata/.plugins/org.eclipse.core.resources/.projects/

and the mapping from Eclipse project to the corresponding git repository is stored in
<workspace folder>/.metadata/.plugins/org.eclipse.core.resources/.projects/<project name>/org.eclipse.egit.core/GitProjectData.properties
Re: How does Eclipse/eGit connect workspace to git repo and its project metadata/source files? [message #1744410 is a reply to message #1744381] Mon, 26 September 2016 15:48 Go to previous message
Les Gasser is currently offline Les GasserFriend
Messages: 3
Registered: September 2016
Junior Member
Matthias, thanks very much for the clear and informative answer.
I really appreciate it!

- Les
Previous Topic:Cherry command available?
Next Topic:How to get content of files with JGIT
Goto Forum:
  


Current Time: Thu Apr 25 20:21:21 GMT 2024

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

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

Back to the top