How to create an Eclipse project from an existing git repository

I have an existing project using git and just installed eclipse along with egit. I pointed to the git repository using egit and can see all my files, my existing branches and switch between branches.

When I open the file from the git repository view, it does not seem to recognize that it is a php file, does not show me the classes inside it and does not execute code completion. If I just dragged a file from Explorer, it at least recognizes this file as php, but does not understand the project well enough to show me code completion from installed libraries. I think I need to configure eclipse to understand the project home directory, but I got a little lost. Any help would be greatly appreciated.

+4
source share
3 answers

Your answer may fall under this guide to change the "nature" of your project. It is at least worth exploring. I will try to do what you described for some time this week, so hopefully this will work. The wiki document also suggests that some "natures" may conflict with each other, but I hope this does not happen. Link β†’ http://wiki.eclipse.org/IRC_FAQ#How_do_I_manually_assign_a_project_Nature_or_BuildCommand.3F

After you try to reproduce your steps, I have the same experience. I believe this may be the β€œexpected” behavior. For clarity, when I open a php file from the "PHP Explorer" view, everything works fine, but when I open a php file from the "Git Repositories" view, Eclipse treats it as a text file (without code highlighting, etc.).) . I suggest you work with the PHP Explorer view and leave the Git Repositories view open only for viewing / monitoring the repository, not as a working file view for editing, but what not.

+2
source

You need to open it as a PHP project from the existing source (GIT working folder), and then share the project with Git, that is, right-click on the project, go to the command "Team"> "Share", click Git.

See http://www.youtube.com/watch?v=-Zba8iAnLms for a demo.

+2
source

Have you installed the pdt plugin in eclipse? It should recognize any open .php file. It doesn't matter where it is.

0
source

All Articles