Aero Wang
Aero Wang

Reputation: 9217

Why doesn't Heroku accept empty folders?

Hi I am currently trying to deploy an app on Heroku (well actually I did it 2 years ago but only recently I noticed this bug), and I have a folder structure like this: /work/{{id.name}}/{{id.tag}} and since tags limited to three currently the folders are pre-generated before deploy and they are empty. The problem with Heroku (and it works on AWS or IBM Bluemix) is that it does not seem to allow the unload of empty folders (at least not completely). I have some folders existing, like /work/alina/outdoor/ but some disappeared like /work/james/indoor...

I like to know if this is a Heroku bug or a Git bug, or perhaps it isn't really a bug just something I did wrong when deploying or pushing to Heroku's git repo...thanks.

Upvotes: 3

Views: 860

Answers (1)

Damien MATHIEU
Damien MATHIEU

Reputation: 32629

This is not an Heroku restriction. It's a GIT one. It won't track folders with no files inside them.

The solution to this is to create a hidden file inside that folder, so it looks empty but truly isn't. The convention is usually to name that file .gitkeep.

Upvotes: 8

Related Questions