Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is not recommended to have an Eclipse project folder as a Git repository?

When sharing a project as git and trying to make the Eclipse project folder as the git repository, Eclipse says that it is not recommended to do so and that it should be outside the Eclipse workspace.

Why is that?

like image 680
David Hofmann Avatar asked Jan 01 '13 01:01

David Hofmann


People also ask

Can Eclipse work with Git?

Eclipse EGit™ is the Git integration for Eclipse. Git is a distributed SCM, which means every developer has a full copy of all history of every revision of the code, making queries against the history very fast and versatile.

What files should not be stored in Git?

You shouldn't store credentials like usernames, passwords, API keys and API secrets. If someone else steals your credentials, they can do nasty things with it.

How do I add an Eclipse project to GitHub?

Step 1: Open Eclipse IDE and right-click on the project you want to push and go to Team->share project. Step 2: It will add the project to the given repository as shown below: Step 3: Again right-click on the project and go to Team->commit.

Does Eclipse support GitHub?

Most Eclipse IDE distributions from Eclipse.org already contain support for Git. In this case no additional installation is required.


1 Answers

While I agree about keeping the repository outside the Eclipse workspace, and I would still make a git repo within an Eclipse project root directory (like in this answer).

Unless your program is composed of lots of little inter-dependent projects, I would limit one git repo to one Eclipse project.
A git repo is about recording the content of a tree structure, and if that tree represents one project, it is easier to manage, tag, branch, merge (as a coherent set of files).
If it represents multiple project, you are not sure anymore about what a tag like "1.0" represents for each of the projects in that Git repo.

Plus, I like to add the .project, .classpath and .settings to the Git repo (as "Does git exclude eclipse project files from a new repo by default?")

like image 193
VonC Avatar answered Sep 30 '22 09:09

VonC