Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making .gitignore ignore nested folders in tmp dir

Tags:

git

This is my .gitignore file

.bundle
db/*.sqlite3*
log/*.log
*.log
tmp/*
doc/
*.swp
*~
.project
.DS_Store
log/*
Gemfile.lock

So why does it keep saying things like this:

# Changes not staged for commit:
#   modified:   tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af

i.e Why is it not ignore my tmp dir? As the file and directory names seem to be random, I don't suppose I can add them explicitly.

like image 765
Christian Mayne Avatar asked Nov 18 '25 20:11

Christian Mayne


1 Answers

Just put tmp/ on a line on its own, not tmp/*.

like image 194
Graham Perks Avatar answered Nov 20 '25 15:11

Graham Perks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!