gitignore ignore files within a folder that has whitespace in the middle

Try My\ FolderName/Web.config or "My FolderName/Web.config"