Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Creation of repositories in the Eclipse workspace is not recommended(warning message during sharing of a project)
Creation of repositories in the Eclipse workspace is not recommended [message #1829310] Wed, 01 July 2020 10:11 Go to next message
Vito De Tullio is currently offline Vito De TullioFriend
Messages: 2
Registered: July 2020
Junior Member
Hi.
I have some doubts on a warning appearing.
I have ecplise opened on a workspace on C:\Users\Me\workspace.
I create a new project in C:\Users\Me\workspace\MyProject
I then want to put it into version control.
I do right click on "MyProject" -> Team -> Share project... -> choose git -> select "Use or create repository in parent folder of project" -> select MyProject from the list.

What is see is in the attached "share-project.png" image.

what I don't understand is what is the meaning of the warning, and why does it appear.
what I want to obtain is this "tree"

workspace
    MyProject1
        .git
        <stuff>
    MyProject2
        .git
        <stuff>
   ...


but I don't understand if there is a problem
Re: Creation of repositories in the Eclipse workspace is not recommended [message #1829333 is a reply to message #1829310] Wed, 01 July 2020 14:11 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 374
Registered: August 2016
Senior Member
The parent folder of the project would be "workspace". Having a git repo there is discouraged because it may include way more than you'd expect: also MyProject2 in your example, and even workspace-private data under workspace/.metadata.

I'd even say having git repositories physically anywhere under the Eclipse workspace directory is not the best setup. Personally I prefer to keep things completely separated: all my git repositories are under a "git" folder in my home directory, my Eclipse workspaces are elsewhere. Eclipse projects can be located physically outside the workspace directory. If you want that, the easy way to get that is to not use "Use or create repository in parent folder of project" but the "Create..." button.
Re: Creation of repositories in the Eclipse workspace is not recommended [message #1829369 is a reply to message #1829333] Thu, 02 July 2020 07:35 Go to previous messageGo to next message
Vito De Tullio is currently offline Vito De TullioFriend
Messages: 2
Registered: July 2020
Junior Member
Thomas Wolf wrote on Wed, 01 July 2020 14:11
The parent folder of the project would be "workspace". Having a git repo there is discouraged because it may include way more than you'd expect: also MyProject2 in your example, and even workspace-private data under workspace/.metadata.


sorry but I don't understand, the git repo is in the directory workspace\MyProject1, what informations are you talking about? surely not the workspace\.metadata directory, nor the workspace\MyProject2

Thomas Wolf wrote on Wed, 01 July 2020 14:11
I'd even say having git repositories physically anywhere under the Eclipse workspace directory is not the best setup. Personally I prefer to keep things completely separated: all my git repositories are under a "git" folder in my home directory, my Eclipse workspaces are elsewhere.


ok, this is about personal preferences, but I disagree with you about it: the workspace directory "raison d'ĂȘtre" is to actually collect the projects!
Is you workspace directory empty?

Thomas Wolf wrote on Wed, 01 July 2020 14:11
Eclipse projects can be located physically outside the workspace directory. If you want that, the easy way to get that is to not use "Use or create repository in parent folder of project" but the "Create..." button.


Umm... I tried to follow your advice, but now I'm stuck with a different problem.
Maybe it's my eclipse setup (it's a very old version continually updated, so it may have accumulated some cruft), but if I do "team" -> "share project" -> "Git" and the click on the "Create..." button... nothing happens!

I will try later with a new ecplipse installation.

Could you be so kind to tell me what that button does?

Thanks
Re: Creation of repositories in the Eclipse workspace is not recommended [message #1829371 is a reply to message #1829369] Thu, 02 July 2020 07:51 Go to previous message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 374
Registered: August 2016
Senior Member
The "Create..." button opens a dialog to create a new repository, by default suggesting a location under C:\Users\Me\git.
Previous Topic:How to pass the Git tag value to a Maven build run by Eclipse to embed into the WAR file manifest?
Next Topic:not authorized
Goto Forum:
  


Current Time: Sun Jun 20 21:13:13 GMT 2021

Powered by FUDForum. Page generated in 0.01732 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top