2

Besides not being able to add another project to the same git repository, is there any other reason to not create a git repository (.git directory) inside an Eclipse Project folder? Currently my project directory structures look like this (with a .git repository inside it):

MyProject
  .git
  bin
  src
  .classpath
  .project
  .gitignore

Should I place the git repository outside the project folder?

Tim
  • 41,901
  • 18
  • 127
  • 145
Marcos
  • 1,237
  • 1
  • 15
  • 31
  • *Should I place the git repository outside the project folder?* why would you want that? its fine this way – Tim Jul 05 '14 at 14:28
  • _"why would you want that?"_ Well, I've seen some setups in some tutorials that took this approach. I just would like to know if they were recommended or even if that was the correct approach, for some reason I don't know. – Marcos Jul 05 '14 at 14:36

1 Answers1

3

No, you can keep in within the MyProject folder: the gtit repo will match your Eclipse project.

Keeping it outside would only be useful if you wanted to version multiple project in the same git repo.

You might want to ignore IDE-specifc files (although I prefer keeping them, especially if the .classpath uses relative paths).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • By the way, why would I want to version multiple projects in the same git repository? Wouldn't this mess things up? – Marcos Jul 05 '14 at 14:42
  • 1
    @Marcos That could make sense if those projects are tightly linked together. Otherwise, it is best to limit one Eclipse project to one git repo. Each project can then have its own history. – VonC Jul 05 '14 at 14:43