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

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?

1 Like

usually whole UserSettings/ folder is ignored from git,
this is good gitignore: gitignore/Unity.gitignore at main · github/gitignore · GitHub

3 Likes

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).

5 Likes

I put “[Uu]ser[Ss]ettings/” inside .gitignore, but it doesn’t work

1 Like

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 :slight_smile:

2 Likes

An even easier way which does not require copying files. Just remove the file from the index as explained here

6 Likes

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:

git lfs migrate import --include="*.dwlt"

Then your commit and push will work as normal.

Me too.

very cool

Thank you so much

Even better, thank you very much indeed!

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.

For someone doesn’t like use console, you can go to your git project → click UserSettings → then proceed delete directory.

Screenshots:



2 Likes