First install the ignore plugin:
Then right-click the project root directory: New
> .ignore File
> .gitignore
If you want to simply create a .gitignore file in PyCharm, go to the PyCharm terminal and type: echo "" > .gitignore
. Then open the .gitignore file, delete the double quotes, and update however you'd like.