How to separate Eclipse and Git metadata [message #1006557] |
Thu, 31 January 2013 17:31 |
Malte Forkel Messages: 10 Registered: January 2013 |
Junior Member |
|
|
Hello,
I would like to use Eclipse and EGit to work on projects that use Git repositories but don't necessarily use the Eclipse platform. So I would like to keep Eclipse metadata out of the repository. Unfortenately, I can't manage to setup my directory structure accordingly.
After reading the Considerations for Git Repositories to be used in Eclipse, I cloned the remote Git repositories to directories outside of the Eclipse workspace. Now, whether I use Import... > Git > Projects from Git or first add the repositories in the Git Repository Exploring perspective and import then, I always seem to end up with a layout like
- Eclipse workspace
.metadata
- project directory (and Git working directory)
.project
.git
...
The Eclipse project metadata is inside the Git working directory. Which is what I'd like to avoid.
I thougt a layout like this would be more suitable:
- Eclipse workspace
.metadata
- project directory
.project
- working directory
.git
...
Adding the working directory to the project as a linked folder will result in this directory layout. But the working directory is not displayed as a Git repository in the Project Explorer and, more importantly, there are not Git commands below Team in the context menu.
May be my idea of how to setup things is flawed? How are you doing this?
Thanks,
Malte
Eclipse Platform, Version: 4.2.1.v20120814,
Eclipse EGit, Version 2.1.0.201209190230-r
|
|
|
|
|
|
Re: How to separate Eclipse and Git metadata [message #1006644 is a reply to message #1006634] |
Fri, 01 February 2013 10:08 |
Malte Forkel Messages: 10 Registered: January 2013 |
Junior Member |
|
|
Hello Fabien,
thanks for your suggestion.
I had thougt about that, but I don't think its a safe solution.
If I used .gitignore, I'd have to make sure that all Eclipse metadata files were listed and not used by the project itself. Plus, I'd have to differentiate between my changes to .gitignore that are project-related (and which I'd want to push) and changes to .gitignore that are Eclipse-specific (which I wouldn't want to push).
Generally, I think Eclipse should not force me to clutter my project with its metadata. There is no guarantee that Eclipse metadata files won't interfere with regular project files, especially if many people work on the same project using different tools. E.g., even .project might be a valid file in the original project.
So, while .gitignore might work most of the time, I still hope there is another way to organize the project in Eclipse.
Regards,
Malte
|
|
|
|
|
|
|
Re: How to separate Eclipse and Git metadata [message #1007007 is a reply to message #1006835] |
Sun, 03 February 2013 19:33 |
R Shapiro Messages: 386 Registered: June 2011 |
Senior Member |
|
|
[Quote:There is no guarantee that Eclipse metadata files won't interfere with regular project files
This is the core of your problem. If it's a realistic concern, rather than a purely theoretical one, you might as well give up on Eclipse right now: there's no way you'll ever get it to work if some 'regular' file conflicts with an Eclipse metadata file.
If it isn't a real concern, and chances are excellent that it isn't, then you have two good options, both of which will solve your problem: commit the metadata files, or add them as gitignored. Both are very simple to do. Committing them has the advantage of helping your team-mates use Eclipse too. Surely at least one of them would appreciate this?
[Updated on: Sun, 03 February 2013 19:46] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04450 seconds