Hey everyone, I wanted to give you all a quick PSA regarding the .gitignore file.
A quick explanation for those who don’t yet know what a .gitignore file is, the .gitignore file is a file that defines what files git should not see as changed when you’re about to commit something. There is currently a generic Unity .gitignore file in the project which ensures that the library, obj, logs and other data that isn’t required for the project to be re-build will not be added to git. This both helps keep the git history clean and avoids the project from getting too big to host.
Since we’re most likely using many different IDEs to write code for the project you might think that it would be a good idea to add any files specific to your IDE that it generates in the project folder to this general .gitignore, the problem with that is that this file would then grow quite big in order to support all the different IDEs that may exist which isn’t really a clean approach. Instead you can create a local global .gitignore file, this would ensure that your IDE specific files don’t get pushed to any repo on that machine anymore and keep the shared .gitignore cleaner for everyone else.
You can find a guide on how to achieve this here, Global gitignore · GitHub
Myself I use Jetbrains Rider and thus my global gitignore is simply this
.idea/
And after this change I no longer have to watch out for accidentally adding the .idea folder in my commits without having to alter the gitignore of the project. To know exactly which files to ignore for your IDE you can simply find it on Google. Hope it helps!