Search Unity

which folders should I add to git

Discussion in 'External Tools' started by andrew_pearce_, Jan 5, 2019.

  1. andrew_pearce_

    andrew_pearce_

    Joined:
    Nov 5, 2018
    Posts:
    31
    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. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,225
    Unity folders to add to Version Control:
    • Assets
    • ProjectSettings
    • Packages / UnityPackageManager

    Unity folders to ignore in Version Control:
    • Library
    • Temp
    • SwitchIL2CPPCache (created when you execute an IL2Cpp build)
    • SwitchIL2CPPStats (created when you execute an IL2Cpp build)

    Here is a more in-depth article on what things to add and ignore:
    https://unity3d.com/learn/tutorials...ject-folder-structure-version-control-systems

    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
     
    andrew_pearce_ likes this.
  3. andrew_pearce_

    andrew_pearce_

    Joined:
    Nov 5, 2018
    Posts:
    31
    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!
     
  4. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,225
    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.
     
    andrew_pearce_ likes this.
  5. andrew_pearce_

    andrew_pearce_

    Joined:
    Nov 5, 2018
    Posts:
    31
    Thanks a lot once again for your help!
     
    Peter77 likes this.