Open eclipse projects synchronized with git that are outside the workspace

I have a project outside the eclipse workspace, and I use git to update it, and I want to use eclipse to work with files. But if I import existing projects into the workspace in eclipse, will it only copy the contents of the project at that time? So, when I make new changes to the project, will the files automatically update in eclipse?

+4
source share
4 answers

Clicked Import Existing projects into workspace , and then selected the folder that was outside and left copy projects into workspace unchecked. Now it works.

+9
source

But if I import existing projects into the workspace in eclipse, will it only copy the contents of the project at this time?

A project in eclipse is not just a copy of a project. Strictly speaking, an eclipse will make references to the dir project.

So, when I make new changes to the project, will the files automatically update in eclipse?

If the project has changed beyond the eclipse, they will be automatically updated. But you need to update the project in eclipse. Before updating the project, the eclipse will display a message.

+2
source

You can also use the Eclipse git integration plugin "egit" to do all your git control from within Eclipse. He does a great job with projects outside the workspace.

One of the advantages of this is that you avoid the need to manually synchronize the contents of currently open editors, since the modified file on disk is processed correctly inside Eclipse, and the contents of (not polluted) editors are automatically updated.

+1
source

@Bananeweizen, the only problem with egit is that it creates a .project in the project directory. You can add ".project" to .gitignore, but there is no way for this file to be outside of your project directory. your egit will throw an error.

my ideal setup is to have .project and other metadata outside my project directory. something that the eclipse cannot do (with and without egit).

0
source

All Articles