How to separate Eclipse and Git metadata [message #1006557] |
Thu, 31 January 2013 12:31  |
Eclipse User |
|
|
|
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 05:08   |
Eclipse User |
|
|
|
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 #1007015 is a reply to message #1006835] |
Sun, 03 February 2013 19:07  |
Eclipse User |
|
|
|
Malte Forkel skrev 2013-02-02 18.07:> Philippe, I'm not quite sure which of the import commands you are referring to. I have tried File > Import... and Import... in the
Project Explorer's context menu of the
> C++ Project View as well as Import Projects... in the Git Repositories View. In the end, they all guide me into creating a new project with the working directory coinciding
> with the workspace directory.
>
> The only way I found to come close to the setup that I like is to import a remote repository to a destination outside of the workspace and cancel the wizard before a new
> project gets created. I can then add that repository as a linked folder to a project. But I have to manage the repository in the Git Repository View because there are no
> repository-related commands available in the Project Explorer's context menu.
> I guess, my preferred directory layout simply is not supported by EGit.
In the third page of Import..Project from Git you can enter a directory where you want to clone to land, including inside your workspace the way you describe.
-- robin
|
|
|
Powered by
FUDForum. Page generated in 0.05962 seconds