which folders should I add to git

Hi guys,

Since /Library folder is too big, I excluded it from git repository. What I can see now is that when I switch between branches (which has different files in resources folder, Unity stars importing everything. I would not bother you but the difference is in 3000 small files and it takes few minutes to finish import process.

Could anyone tell me which file or folder is responsible for that list, so I can add it to git and prevent that reimport every time I switch branches.

Thanks

2 Likes

Unity folders to add to Version Control:

  • Assets

  • ProjectSettings

  • Packages / UnityPackageManager

Unity folders to ignore in Version Control:

  • Library

  • Temp

  • Logs

  • MemoryCaptures (when you use Unity’s Memory Profiler package)

  • obj

  • UserSettings

  • .vs

  • SwitchIL2CPPCache (created when you make an IL2Cpp build)

  • SwitchIL2CPPStats (created when you make an IL2Cpp build)

  • All the *.csproj and *.sln files located in the project root directory

Here is a more in-depth article on what things to add and ignore:

You can’t prevent the re-import process completely at the time of writing. You can set up a Cache Server, which speeds up this process significantly:
https://docs.unity3d.com/Manual/CacheServer.html

11 Likes

Thanks @Peter77 , that’s exactly what I was looking for. I just tested with local Cache Server enabled and it took just 20 seconds, awesome result!

  1. BTW what’s the advantage of remote cache server besides it’s shared between other developers?

  2. Should I ignore Assembly-CSharp and Assembly-CSharp-Editor in root folder as they are constantly changed. I assume those are editor’s interface specific files.

I will definable read through both links, thanks!

1 Like

We use it to avoid team members having to wait too long when pulling content from version control, as well as to speed up build servers. Not sure what other benefits there are. You could probably ask this in the Cache Server forum if you’re interested.

If you refer to the *.csproj files, then yes.

3 Likes

Thanks a lot once again for your help!

2 Likes