I use Manual Deploy and Start to deploy my static site using CLI. I use .gitignore file and have temp_directory and don’t want this directory to be deployed and published. but it always published
I don’t believe the netlify deploy command is Git-aware at all and it does not take into account any .gitignore file(s) — we can see some of the source behind the command here:
There isn’t any filtering or considerations for .gitignore files — the command deploys the full folder
Hi, @Mikka. +1 to what @jonsully said. The file .gitignore is used by Git and not by the Netlify CLI tool. The Netlify CLI tool does not look at that file when deploying.
To resolve this, put only the files you want to deploy in the publish directory. You might write a custom script to do this.