Search Unity

Resolved GitHub doesn't ignore the UserSettings folder and the "default-2021.dwlt" file

Discussion in 'Editor & General Support' started by Pietrofonix, Dec 27, 2021.

  1. Pietrofonix

    Pietrofonix

    Joined:
    Aug 1, 2020
    Posts:
    54
    Hi guys, i hope this is the right place to ask this question, I have a little problem with Unity and GitHub. Basically I have created a repository in GitHub with my Unity project and everything works just fine, except that everytime, even if I only open and close my Unity project without changing anything, GitHub desktop reports that 1 file has changed. This file is "default-2021.dwlt" inside the UserSettings folder. I tried putting the UserSettings folder inside .gitignore, but GitHub keeps reporting that default-2021.dwlt has changed. I also told GitHub to ignore this specific file but it didn't work. Do you know how to solve this problem? Should I leave this thing and just commit and push everytime?
     
    Last edited: Dec 27, 2021
    KpyaccaH likes this.
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    curbol, KpyaccaH and JonBFS like this.
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,748
    Once a file is being tracked by git, it will always be tracked by git until you tell git to delete it.

    Now that you have that directory in your gitignore, then just
    git rm
    to delete the entire contents of the UserSettings/ in your project, commit that remove, and now you won't hear about it anymore.

    (Obviously if you need the files in there, make a copy first, delete, then after committing, put the copy back).
     
  4. Pietrofonix

    Pietrofonix

    Joined:
    Aug 1, 2020
    Posts:
    54
  5. Pietrofonix

    Pietrofonix

    Joined:
    Aug 1, 2020
    Posts:
    54
    YES it worked, thank you very much. I made a copy of the files, then i deleted and committed and in the end I put the files again into the folder. Now i don't have messages anymore :)
     
    Kurt-Dekker likes this.
  6. JonBFS

    JonBFS

    Joined:
    Feb 25, 2019
    Posts:
    39
    An even easier way which does not require copying files. Just remove the file from the index as explained here
     
    RaL, curbol, droemmelbernd and 3 others like this.
  7. gemsword-jay

    gemsword-jay

    Joined:
    Nov 25, 2021
    Posts:
    3
    In case is getting this extremely annoying error:
    File UserSettings/Layouts/default-2022.dwlt is XXX.XX MB; this exceeds GitHub's file size limit of 100.00 MB

    You can silence Git by committing the file via Git LFS using this command:
    Code (JavaScript):
    1. git lfs migrate import --include="*.dwlt"
    Then your commit and push will work as normal.
     
  8. wankcn

    wankcn

    Joined:
    Oct 10, 2022
    Posts:
    2
  9. wankcn

    wankcn

    Joined:
    Oct 10, 2022
    Posts:
    2
    very cool
     
  10. Alex_May

    Alex_May

    Joined:
    Dec 29, 2013
    Posts:
    198
    Thank you so much
     
  11. Alex_May

    Alex_May

    Joined:
    Dec 29, 2013
    Posts:
    198
    Even better, thank you very much indeed!
     
  12. SassyPantsy

    SassyPantsy

    Joined:
    May 17, 2020
    Posts:
    142
    PERFECT. This was driving me crazy !

    By the way, if anybody gets the message fatal: not removing 'your/directory' recursively without -r, write
    git rm -r
    . It might then throw some error about doing it with force or something, so write
    git rm -r -f
    and it will work.
    By the way, you need to only run this command from the directory you want to remove. Be careful not to delete your entire project.
     
  13. restush96

    restush96

    Joined:
    May 28, 2019
    Posts:
    145
    For someone doesn't like use console, you can go to your git project -> click UserSettings -> then proceed delete directory.

    Screenshots:

    upload_2023-9-24_3-49-29.png
    upload_2023-9-24_3-50-13.png
    upload_2023-9-24_3-49-34.png