Git – New vs Clone Git in Eclipse with EGit

eclipsegitgithub

I'm not sure I have either my new repo or clone repo workflow, or both, setup correctly. When I create a new project I create a repo on github, can't clone from it as it's empty so I create a new project which goes into my workspace and then the git init runs on the workspace copy. So I end up with everything in workspace\project-name.

However, when I clone from github first I need to clone the repo and this goes into my default git directory (C:\git) as git\cloned-project-name, I then need to import this Git repo as a project into my workspace and I end up with workspace\cloned-project-name effectively duplicating the project folder in the git area.

I've tried to clone to workspace\cloned-project-name but then it asks to import the git project and if I try to use workspace\cloned-project-name again, it errs.

What am I doing wrong? Thanks, Matt.

Best Answer

you prefer working in the git/cloned-project-name directory, right ? After your start the eclipse, did you use import ? or you did the New Project ?

If you use import and select "Existing XXX projects", e.g. Existing Maven Project. then it does not use workspace as working directory.

If you select "New Project", there is an option "USe default workspace location", just uncheck it :

(Ops i could not post images yet ...)