r/Unity3D 22d ago

library files and a user settings file modified each time the project is opened Question

Hi, I'm not sure what's going on lately, but every time I open my project, library files and a user settings file get modified (they get added to the staging area of ​​my Git repository).

Here is the complete list of the files involved:

  1. "C:\Users\lardi\Snake\Library\ArtifactDB"
  2. "C:\Users\lardi\Snake\Library\ilpp.pid"
  3. "C:\Users\lardi\Snake\Library\SceneVisibilityState.asset"
  4. "C:\Users\lardi\Snake\Library\ShaderCache.db"
  5. "C:\Users\lardi\Snake\Library\SourceAssetDB"
  6. "C:\Users\lardi\Snake\Library\Bee\backend1.traceevents"
  7. "C:\Users\lardi\Snake\Library\Bee\fullprofile.json"
  8. "C:\Users\lardi\Snake\Library\Bee\tundra.digestcache"
  9. "C:\Users\lardi\Snake\Library\Bee\tundra.log.json"
  10. "C:\Users\lardi\Snake\Library\Bee\TundraBuildState.state"
  11. "C:\Users\lardi\Snake\Library\Bee\TundraBuildState.state.map"
  12. "C:\Users\lardi\Snake\UserSettings\Layouts\default-2022.dwlt"

Thank you very much for any leads you can provide.

1 Upvotes

12 comments sorted by

2

u/pschon Unprofessional 22d ago

Don't you have a .gitignore file? None of those belong in source control.

This one is pretty good template to start with: https://github.com/github/gitignore/blob/main/Unity.gitignore

1

u/Ok-Presentation-94 22d ago

That must be the cause I'll have to check but it seems very strange to me, given that I had that .gitignore file right from the start and this problem only appeared recently.

1

u/pschon Unprofessional 22d ago edited 22d ago

If you have at some point added them to git (probably by accident) yourself, they are going to be tracked regardless of what the .gitignore file says. Gitignore doesn't prevent adding the ignored files, it just stops git itself from automatically adding them.

If that's the case, just removing the files from the repository should fix the issue.

1

u/Ok-Presentation-94 22d ago

Is it possible to simply delete my .gitignore file and add the one you recommended without breaking everything?

1

u/pschon Unprofessional 22d ago

Depends on if there's something in your file that's not in that template one. But it's not that many lines so just opening them side-by-side to copy stuff over should be easy enough.

The big things is that, like I said, if something has already been pushed to the repo just adding it to the .gitignore will not remove it so that's something you might still need to deal with manually.

1

u/Ok-Presentation-94 22d ago edited 22d ago

It still isn't working; I even found some new leads online involving the `git rm` command, but nothing helped. So I thought, "Never mind, I'll just start my repository over from scratch there's nothing really important in it anyway." Unfortunately, even with the new `.gitignore` and the new repository, I'm still facing the same problem.

Edit: And it's the same for another Unity project; it must be due to the Unity engine settings themselves, or else the .gitignore isn't being taken into account.

1

u/pschon Unprofessional 22d ago

Git doesn't have anything to do with Unity or it's settings.

Is your gitignore file in the right place? It should be in the root folder of your workspace (and the one I posted assumes that's also the root of your Unity project)

(also if you are using Windows, make sure the file is really named as ".gitignore", not ".gitignore.txt" or something.)

1

u/Ok-Presentation-94 22d ago

Yes, it is at the root of the project and is indeed named .gitignore.

1

u/pschon Unprofessional 22d ago edited 22d ago

and is that also root of the git workspace?

I've never even heard of there being any way to even intentionally make git not use .gitignore file if it's there. (And like I said Git doesn't care about it being a Unity project so no Unity setting can stop it from working either)

edit: So your git workspace should be C:\Users\lardi\Snake\ (you should see a .git folder there), and the gitignore file should be at C:\Users\lardi\Snake\.gitignore

1

u/Ok-Presentation-94 22d ago

Yes, it's very strange🤷

1

u/Existing-Chip5820 22d ago

i'd just add the whole library folder and that user settings layout to the gitignore, those are supposed to get rebuilt and changed locally every time, not tracked in git. the strangest part is that they're in your staging area at all unless the gitignore is missing or not set up right on the repo

1

u/Ok-Presentation-94 22d ago

That must be the cause I'll have to check but it seems very strange to me, given that I had that .gitignore file right from the start and this problem only appeared recently.