Should I add .log files to gitignore?

New to unity and I am busy with the tutorials.

The log files are constantly popping up and cluttering my commits. These are not in the git’s ignore file for unity by default. Is it safe to ingore these log files or should I be committing them?

e.g.
Logs\AssetImportWorker0.log
Logs\shadercompiler-AssetImportWorker0.log
Logs\shadercompiler-UnityShaderCompiler.exe0.log

Thank you.

3 Likes

I do not source control logs. All the Unity .gitignore files I have seen leave them out. While there might be interesting data in the logs, it’s unlikely they would actually aid you in any forensic bug hunting.

1 Like

The default .gitingore from Github Desktop isn’t excluding it and I was wondering if there was a reason. I’ll exclude it. Thank you!

1 Like

Would you be able to add them? Even if i add them in gitignore, they keep appearing

Once tracked, they are controlled and ignoring them is irrelevant.

If you tracked files inadvertently and now want to ignore them, you need two things:

  • delete them from git
  • add them to the .gitignore.
1 Like