touch .gitignore works just fine. Windows detects it as a text file but git should works perfectly.
To be sure of it, you can type ls -la and you should see all your files with their extensions, including .gitignore just like in the following picture: