I have another simple idea
Let's use the echo command in cmd ,
echo ./idea > .gitignore
this will create the .gitignore file having text content "./idea"
you may now manually change data from the file using text editor.
or simply
console :
echo .gitignore notepad.exe
to instantly edit gitignore.
If you dont know which files are should be gitignored for your IDE or Operating System just goto www.gitignore.io