I use the following .gitignore file (global):
.idea
.svn
/media/covers/*
/media/tmp/*
/media/cache/*
/bin
/include
/lib
/local
*.log
*.pot
*.pyc
local_settings.py
So in media/covers
, media/tmp
, media/cache
I want to ignore all files and folders, but not this directories themselves. This .gitignore file ignore media/covers
, media/tmp
, media/cache
dirs, how can I fix it?
TIA!
Add a .gitignore file to the directory that you want to keep. Within that directory put
*
Now when you do a git status, you will see that the contents are not shown as being tracked, only the .gitignore file. And since the .gitignore file is in the directory, that means that the directory will be tracked, but no other contents.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With