How to create Eclipse project from existing git repo
I have an existing project utilizing git and have just installed eclipse along with egit. I pointed to the git repository with egit and can see all my files, my existing branches and can switch between branches.
When I open a file from the view of the git repository it does not seem to recognize that it is a php file, doesn't show me the classes within it and doesn't do code completion. If I just drag a file in from explorer it at lea开发者_如何学运维st recognizes that file as php, but doesn't understand the project well enough to show me code completion from installed libraries. I think I need to configure eclipse to understand the projects home directory, but am a bit lost. Any help would be appreciated.
Your answer may fall within this guide to change the "nature" of your project. It's at least worth exploring. I will be attempting to do the exact thing you've described some time this week so hopefully it will work. The wiki doc also suggests that certain "natures" may conflict with each other but hopefully that won't be the case here. Link --> http://wiki.eclipse.org/IRC_FAQ#How_do_I_manually_assign_a_project_Nature_or_BuildCommand.3F
After just trying to reproduce your steps I am having the exact same experience. I believe this may be "expected" behavior. For clarity, when I open a php file from the "PHP Explorer" view everything seems to work fine but when I open a php file from the "Git Repositories" view Eclipse treats it as a text file (no code highlighting etc.). I suggest that you work from the PHP Explorer view and leave the Git Repositories view open separately only to watch/monitor the repository not as a working view of files to edit and what not.
You need to open it as a PHP Project from existing source (GIT working folder) then share the project with Git, ie, right-click on the project, go to Team > Share project, click on Git.
See http://www.youtube.com/watch?v=-Zba8iAnLms for a demo.
Did you install the pdt plugin in eclipse? It should recognize any .php file opened. Shouldn't matter where it's located.
精彩评论