Reputation: 6552
How do I ignore files in a specific directory, but not the directory itself, in Git? I can add a line to the .gitignore file, but it'll ignore the entire directory. What sort of syntax does .gitignore support in order to achieve what I want?
Upvotes: 1
Views: 178
Reputation: 6509
This is all about how git handles empty directories, and actually has nothing to do with .gitignore
(other than the fact that it's the ignore file that is causing you to have an empty directory)
See here How can I add an empty directory to a Git repository?
Upvotes: 0
Reputation: 1585
You can use any of these
dir/*
- It ignores all the files in dir
directory but not it's sub directories.
dir/**
It ignores all the files in dir
direcotory and it's subdirectories.
Upvotes: 0
Reputation: 301097
Simplest way would be to add a .gitignore
within the directory and add the files to ignore in it.
Upvotes: 1