I am working on a php web application where I need a directory named "library" to always be left untouched by git. 
The reason is that this directory is used for the storage of other files and folders that the user might upload from within my php application to the server. So, it contains items on my local machine and different items on the staging server that i am using, which should not be deleted, ever.
I understand that i can .gitignore the "library" directory, but i am reading warnings about git possibly deleting gitignored items, at some point. 
Is there any method for explicitly protecting a directory or a file?
 
     
     
     
    