Reputation: 1876
I have this directory structure:
app/.bundle/
app/file1.bundle
app/tmp/file2.bundle
app/.gitignore
I would like to add an entry in .gitignore that only ignores files that ends with .bundle.
Doing *.bundle
will also ignore the folder .bundle
, but I want it checked in along with the contents.
Upvotes: 8
Views: 2717
Reputation: 6891
If you have a directory with a file of the same name samename/samename then I believe you can add to your .gitignore file:
samename/samename
Then only the file but not the directory will be ignored. If you only have
samename
in your .gitignore file then both the directory and the file will be ignored. In your first version the file with the same name in a different directory will not be ignored. Say differentname/samename will not be ignored. Let me know if I am wrong.
Upvotes: 0
Reputation: 387607
You can do this:
*.bundle
!.bundle/
This will ignore everything that ends with .bundle
, except a folder that is called .bundle
.
Upvotes: 18