1

I pulled a project from my Git repository but the src/test/java, src/test/resources and src/main/resources source folders do not appear. They were empty before I pushed, and when I tried cloning the repo on a different computer I did not get these source folders.

I even tried creating them manually, but Eclipse says they already exist, so I'm stuck with the warning/error.

Kingamere
  • 9,496
  • 23
  • 71
  • 110

1 Answers1

2

They were empty before I pushed

git does not add empty content. So if no file in them they will not be commited.

The convention is to put dummy file in the folder named `.gitkeep' so git will track the folders.
The reason is that git does not track file names or folders. it track content and if there is no content it does not track it.


Git store only content and if there is no content it does not track it.
You can read a bit about it here:
How does git status work internally?

Community
  • 1
  • 1
CodeWizard
  • 128,036
  • 21
  • 144
  • 167