Reputation: 8772
I have a folder inside the static
directory of an app in a Django project. Lets call this special_folder
. It contains some static files that I do not want to commit to Git. The project directory looks something like this:
myproject
|
+-- manage.py
|
+-- .gitignore
|
+-- myapp
|
+-- static
|
+-- special_folder
Now, if I want to ignore this folder for Git, do I need to add something like the following line to the .gitignore
file:
myapp/static/special_folder/
Is this the right approach? Or should I just add special_folder/
? Thanks for any help.
Upvotes: 0
Views: 2189
Reputation: 48
All paths are relative to the .gitignore.
Based on your folder structure and location of .gitignore file you are correct. The below should work.
myapp/static/special_folder/
Refer Pattern Format.
HTH
Upvotes: 1