Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to git init for Java project?

I've created workspace TestWorkspace and in it, I created project Testing Project(now which has .settings, src, bin folders and .classpath, .project files). I will add my code under this project and I want to host this project on gitHub. In order to do that, I'll have to git init

Where should I git init? In workspace folder TestWorkspace or project folder Testing Project? What is the ideal way so that going further I won't face issues?

like image 532
Alpha Avatar asked Dec 08 '25 21:12

Alpha


1 Answers

From the Egit User guide:

http://wiki.eclipse.org/EGit/User_Guide

It is probably not a good idea to make a project the root folder of your Repository

The reason is that you will never be able to add another project to this Repository, as the .project file will occupy the root folder; you could still add projects as sub-folders, but this kind of project nesting is known to cause lots of problems all over the place. In order to add another project, you would have to move the project to a sub-folder in the Repository and add the second project as another sub-folder before you could commit this change.

It's not a good idea to git init in workspace folder TestWorkspace.

It is a good idea to keep your Repository outside of your Eclipse Workspace.

like image 99
Pier-Alexandre Bouchard Avatar answered Dec 11 '25 09:12

Pier-Alexandre Bouchard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!