Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Should I add .log files to gitignore?

Discussion in 'Editor & General Support' started by nandosmc29, Aug 22, 2021.

  1. nandosmc29

    nandosmc29

    Joined:
    Jul 27, 2016
    Posts:
    4
    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.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    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.
     
    nandosmc29 likes this.
  3. nandosmc29

    nandosmc29

    Joined:
    Jul 27, 2016
    Posts:
    4
    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!
     
    tlskillman likes this.
  4. thekrocker

    thekrocker

    Joined:
    Feb 4, 2021
    Posts:
    4
    Would you be able to add them? Even if i add them in gitignore, they keep appearing
     
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    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.
     
    JackofTraes likes this.