Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git ignore only files with the same name as folder

Tags:

git

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.

like image 630
John Smith Avatar asked Nov 08 '13 01:11

John Smith


1 Answers

You can do this:

*.bundle
!.bundle/

This will ignore everything that ends with .bundle, except a folder that is called .bundle.

like image 101
poke Avatar answered Oct 17 '22 10:10

poke