Reputation: 22291
Say I have a directory .../parent
, containing various files and subdirectories. One of this subdirectories is /parent/slave
I would like to have all the files in .../parent/slave
git-ignored, but not the directory slave
itself - i.e., someone cloning the git repository, would always find an empty slave directory.
What do I have to put into .gitignore
to achieve this?
Upvotes: 0
Views: 294
Reputation: 569
I think you can just about what you want by adding a .gitignore to the ../parent/slave directory with contents such as:
# Ignore everything in this directory
*
# Except this file
!.gitignore
If that doesn't do what you're after, the other answers here may be helpful:
How do I add an empty directory to a Git repository?
Upvotes: 4