Intellij had .ignore
plugin to support this.
https://plugins.jetbrains.com/plugin/7495?pr=idea
After you install the plugin, you right click on the project and select new
-> .ignore file
-> .gitignore file (Git)
Then, select the type of project you have to generate a template and click Generate
.