Home > database >  Creating and sharing a git repository in Eclipse
Creating and sharing a git repository in Eclipse

Time:11-04

when I create a new maven project in Eclipse (version 2022-03) I run into strange problems that I don't understand. Probably I am just too stupid;-)

Let's say I have a project called HelloWorld and I want to put it under version control in the directory d:/git/HelloWorld

When I do that in Eclipse (Team - Share project) I get a dialog (Configure git repository) and when I try to create a repository d:/git/HelloWorld, Eclipse shows me in the target location "d:/git/HelloWorld/HelloWorld" - but that's not what I want.

I'd like to have a separate repository for each project, but directly under the top level directory "d:/git".

I have found out that everything's ok, if I create the git repository in the eclipse workspace but that's not what I want either.

How can I achieve this? What am I missing here?

Strangely if I try to do the same thing in Intellij there's no problem at all

Surely I am doing something stupid - hopefully some of you can explain me what I am doing wrong here:

Thx a lot for your help,

Rudi

CodePudding user response:

If you look at the git documentation here new git Repository wizard

Then when you are ready to share the project, your repository will already be in the selection list for you to pick.

CodePudding user response:

I'm not currently at my laptop to test this, but if you create the repo in d:/git, it should give you d:/git/helloworld. You would still be able to create a subsequent git repos e.g. d:/git/hiworld shouldn't interfere with helloworld.

I am basing this on how git clone works, in my directory I can run multiple git clones to get subfolders of the relevant repos. Hope that points you in the right direction and isn't too far wrong.

  • Related