1

I'm setting up the skeleton for my project, so I created some directories like this under my project root directory:

+src
  |
  +--- etc
  |     +--header.txt
  |
  +--- main
  |     |
  |     +--- java
  |     |
  |     +--- resources
  |
  +--- test
        |
        +--- java
        |
        +--- resources

I committed and push the changes but on my github repo web UI, I only see src/etc

src/main and src/test are not present!!!

Does git NOT allow pushing empty directories? Is there any way to force this?

Thanks

user1508893
  • 9,223
  • 14
  • 45
  • 57
  • 3
    See here: [How do I add an empty directory to a git repository](http://stackoverflow.com/questions/115983/how-do-i-add-an-empty-directory-to-a-git-repository) – Grzegorz Feb 16 '13 at 21:21

2 Answers2

2

Git does not track directories explicitly, but only tracks files. It therefore cannot track empty directories.

Nevik Rehnel
  • 49,633
  • 6
  • 60
  • 50
1

You could create a dummy file in the empty directories you wish to push. Add that file to your repo and the directories will come along for the ride...

Gavin
  • 1,223
  • 15
  • 20