1

I'm more or less a git newbie, trying to get a good Setup to work in Eclipse with egit. I'm running Kepler with latest updates.

Originally I Setup the structure inside the Workspace Directory.

+Workspace/.git
+Workspace/TheProject

Using this Setup (admittedly with Juno) commits were taking forever. For this and other reasons I'd like to move git outside the Workspace Directory, outside eclipse in a parallel Directory.

+OtherDirectory/.git
+Workspace/TheProject

But I'm not getting very far. There seems to be no easy way to split the EXISTING git to another Location without having the Project move there too(!?)

I've tried e.g. Cloning the existing git (in the git repository perspective) and having it Import the Project in the same move. I've tried just Cloning the existing git, without selection of "Import Project" at the same time. Then I right clicked the cloned repository and went through the Import Existing Project dialog. I don't get a Chance to say where the Project should be loaded to.

In both cases the Project Ends up in the same Directory as the .git Directory (now outside the Workspace)

+OtherDirectory/.git
+OtherDirectory/TheProject

and not as I wish - to have the Project in the Workspace Directory.

This must be possible (?), but how?

James Cook
  • 101
  • 1
  • 6

1 Answers1

-1

Simply copy the .classpath and .project from Workspace/TheProject or OtherDirectory/TheProject, to otherDirectory (where the .git folder is).

Then import your project into the workspace, as in "Eclipse - Import an existing project?"

Everything will remain in OtherDirectory/ (outside your Eclipse workspace folder), but will be visible in your Eclipse workspace.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Sorry from where should I copy `.classpath` and `.Project` FROM? I copy these TO `OtherDirectory`? And when you say "Everything will remain in `OtherDirectory`" - do you mean git or the Eclipse Project files `TheProject`... or both? – James Cook Apr 05 '14 at 12:28
  • @JamesCook from `Workspace/TheProject` or `OtherDirectory/TheProject`, where Eclipse must have created them. – VonC Apr 05 '14 at 12:31
  • I've tried this twice now. Just to restate - I'm seeking to SPLIT git Location from the Project Location. I don't want everything under the same Directory. +OtherDirectory/.git +Workspace/TheProject Importing the Project as you indicate leaves the .git and prject directories in `OtherDirectory` (if I don't select to copy the files to the Workspace) or in `Workspace^ if I do – James Cook Apr 05 '14 at 13:07
  • DId you try a File → Import → Git → Projects from Git, as I mentioned in http://stackoverflow.com/a/6760785/6309 – VonC Apr 05 '14 at 13:11
  • @JamesCook otherwise, I like to have the `.project` and `.classpath` in the same folder as the sources, as in http://stackoverflow.com/a/337317/6309. That is, assuming the `.classpath` onlyrefers to relative paths, like in http://stackoverflow.com/a/300346/6309. – VonC Apr 05 '14 at 13:13