1

I think git does not track empty directories by default, but is there any way to make it track them?

I have two empty directories that I would like to be included with a project "images" and "plugins" but both directories are empty by default.

Is there anyway to get this to show up in GitGui so I can commit the empty directories?

I looked at something with a flag of --no-empty-directory, but that didn't seem to do anything. I added it to my exclude file that is in the .git directory of the root of the project folder.

Senica Gonzalez
  • 7,996
  • 16
  • 66
  • 108

2 Answers2

2

I think the idea for GIT is track content. So the empty directory for GIT means nothing. You may have to us something under that directory and try to hide them by some way. Link on linux, you can put "DOT" before you file name like .foo as a work around.

Enze Chi
  • 1,733
  • 17
  • 28
1

I would just mark them by putting in empty .gitignore files in each.

user229044
  • 232,980
  • 40
  • 330
  • 338
Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141