e.g a simple .gitignore file in this case would contain __pycache__/ However it is a good idea to create a more comprehensive file tailored to your IDE. See https://www.gitignore.io/ for examples.