January 14, 2020

Definitive ignore.conf for Unity projects

Why do you need a good ignore.conf?

Unity, like many other editors such as Visual Studio and Visual Studio Code, and many others, creates a wide variety of files that shouldn't be part of the repository. The ignore.conf file contains a list of rules that makes those files and directories not to be tracked by Plastic SCM.

The main advantages of a good ignore.conf are:

  • Smaller repository: Big assets are kept local; therefore, the repository size doesn't grow.
  • Avoid constant conflicts: Automatic files created by IDEs are changed continuously. If they are part of the repository, the users will face merge conflicts every time the IDE changes them locally.

Directories to exclude

Every Unity project is different, but several paths are always part of the Unity project skeleton. The rule of thumb is to exclude all the directories and files that Unity regenerate automatically.

For example, Library and Temp directories are the most populated paths in your Unity project. They can hold thousands of files and weight several GBs, and if you delete them, Unity creates them again.

Unity never-exclude recommendation

Unity recommends never to exclude the Assets and the Project setting directories.

Keep them always added to your Plastic SCM repository. Otherwise, your coworkers will not be able to open the Unity project.

The definitive ignore.conf file

#Common directories
Library
library
Temp
temp
Obj
obj
Build
build
Builds
builds
UserSettings
usersettings
MemoryCaptures
memorycaptures
Logs
logs
**/Assets/AssetStoreTools
**/assets/assetstoretools
**/Assets/AddressableAssetsData/*/*.bin*
**/assets/addressableassetsdata/*/*.bin*
**/Assets/StreamingAssets/aa.meta
**/assets/streamingassets/*/aa/*
.collabignore

# Builds
*.apk
*.unitypackage

#Plastic SCM related
/ignore.conf
*.private
*.private.meta
^*.private.[0-9]+$
^*.private.[0-9]+.meta$

# Gradle cache directory
.gradle

# Autogenerated project files
/Assets/Plugins/Editor/JetBrains*
/assets/Plugins/Editor/JetBrains*
.vs
ExportedObj
.consulo
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Unity3D Generated File On Crash Reports
sysinfo.txt

# Crashlytics generated file
crashlytics-build.properties

#Mac
.DS_Store*
Thumbs.db
Desktop.ini

Share it!

There are two different ways to share the ignore.conf with your coworkers, using Plastic SCM for it, of course.

  1. Add the ignore.conf file to the repository. Add and check the file in, every member of your team will get it the next time they update their workspaces.
  2. Use the Plastic SCM Server global configuration feature to deploy the file on every client at once.

Further reading

Find below several links to read if you are interested in learning more about the private file and the ignore.conf file:

No comments:

Post a Comment