Creating and sharing a git repository in Eclipse

113 views Asked by At

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

1

There are 1 answers

2
Maxime Bélanger On

If you look at the git documentation here https://www.vogella.com/tutorials/EclipseGit/article.html#firstgit_with_eclipse you'll find the missing part: you need to create the git repository before sharing. You can use the basic wizard to do 'create new git repository'.

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.