Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make egit respect multi-project git repository?

Tags:

eclipse

egit

I have a git repository that contains more than one eclipse project. Its easy enough to import the eclipse projects, but I can't figure out how to get them to work with the eGit plug-in.

The tree output below shows the essentials of the directory structure I'm looking at.

bash-3.2$ tree -a
.
|-- .git
    ...
|-- .gitignore
|-- apps
|   `-- example-app
|       |-- .classpath
|       |-- .project
    ...
|-- cs-build.xml
 `-- services
     `-- example-app-service
         |-- .classpath
         |-- .project
         ...

How can I work with these 2 projects AND have eclipse recognize that they are from the same git repository?

like image 485
Bob Kuhar Avatar asked Oct 25 '12 17:10

Bob Kuhar


1 Answers

AHA! I have figured it out! The key is to Import the Project(s) in eclipse after you have the repository itself established somewhere on the disk. During the wizard, Eclipse find the Project(s) and links each of them up to the repository. In my example above, my Eclipse Package Explorer now shows

example-app [example-app master]
example-app-service [example-app master]

The clue that gave me hope was the tutorial here: http://www.vogella.com/articles/EGit/article.html#tutorial_multiprojects

The exact sequence of events was something like...

  1. File, Import...
  2. Git, Projects from Git, Next>
  3. Local, Next>
  4. Add..., Browse , Finish
  5. Select repo from 4., Next>
  6. Import existing projects, Next>
  7. Check the checkboxes beside the projects you want and click Finish

I'm off the command line and back in eclipse complete with feedback as to the status of the repo up through the remotes.

I'm still not so sure its a great idea to keep multiple eclipse projectes in a single repo, but this isn't my repo, its just where I have to work.

like image 66
Bob Kuhar Avatar answered Nov 01 '22 11:11

Bob Kuhar