- Home /
Which Unity project files can be ignored for version control?
Which files / directories in a unity project can be safely ignored when checking into version control (SVN / GIT)?
Temp/
/Library/cache/
Answer by Lance Sun · Jul 17, 2010 at 02:37 AM
This is the ignore list we had for 2.6:
($PROJDIR refers to the top level project directory)
$PROJDIR
obj
Temp
.suo
.user
$PROJDIR/Library
cache
metadata
ScriptAssemblies
assetDatabase3
assetservercachev3
AssetServerCacheV3
AssetVersioning.db
expandedItems
FailedAssetImports.txt
guidmapper
ScriptMapper
unity default resources
unity editor resources
And now for Unity 3.0, we use these ignores:
$PROJDIR
obj
Temp
.suo
.user
.pidb
.userprefs
$PROJDIR/Library
cache
metadata
previews
ScriptAssemblies
assetDatabase3
AssetImportState
assetservercachev3
AssetServerCacheV3
AssetVersioning.db
AudioManager.asset
BuildPlayer.prefs
BuildSettings.asset
DynamicsManager.asset
EditorSettings.asset
EditorUserBuildSettings.asset
expandedItems
FailedAssetImports.txt
guidmapper
InspectorExpandedItems.asset
MonoManager.asset
NetworkManager.asset
ScriptMapper
unity default resources
unity editor resources
Hi Lance, but leaving out these file in the Library has broken the linkages and references to textures, mesh, materials, scripts and prefabs! I think the entire Library folder should be included although Unity docs says don't! I just removed all files lin lib except the ones mentioned in the doc http://unity3d.com/support/documentation/$$anonymous$$anual/ExternalVersionControlSystemSupport.html
And that broke all links!
@Bach Have you enabled external version control? Without it enabled, it will break everything as you've described.
Answer by tonycoculuzzi · Aug 30, 2013 at 02:30 PM
The answers here seem to be outdated, so here's an update I guess:
In the menu, go to Edit > Project Settings > Editor
In the inspector, change Version Control Mode to "Visible Meta Files"
Change Asset Serialization Mode to Force Text
This will ensure that all your metadata is stored in local metadata files, instead of in your Library folder. At this point, the Library folder becomes unnecessary to keep synced between users.
Now you can ignore these files in your preferred version control, including the entire Library folder:
### Directories ###
[Ll]ibrary
[Tt]emp
[Oo]bj
[Bb]uild
[Bb]uilds
### Autogenerated ###
sysinfo.txt
.hg
.git
.vs
*.csproj
*.unityproj
*.sln
*.suo
*.user
*.userprefs
*.pidb
*.booproj
*.DS_store
(note: this is an svn:ignore list, but will need to be formatted to work with other version control systems)
That fixed all my broken references indeed after synching to another machine through git.
Great explanation. Similar from unity (but not as well explained as Our Tonzie :) ) Good one. http://unity3d.com/learn/tutorials/modules/beginner/architecture/folders-in-version-control
GitHub maintains a Unity .gitignore template as part of a larger collection of .gitingore templates for a variety of languages and development environments. Follow Fonzie's above steps to force asset serialization as text and then create a .gitignore with the contents of the Unity .gitignore template.
@11011001 - that should be the accepted answer!
Answer by vzasadnyy · Feb 12, 2014 at 11:58 AM
In general the only folders you should keep under source control are Assets
and ProjectSettings
, other files and folder are generated.
You find more information about Unity and version control systems in my post http://developers.nravo.com/mastering-unity-project-folder-structure-level-0-vcs
Answer by Bach · Oct 13, 2010 at 02:12 PM
Just Include the entire Library folder!!
My mistake is I tried to ignore the files Lance mentioned above. But not having those files has broken my project, and all links to textures, mesh, materials, prefabs and scripts.
Have you enabled external version control? Without it enabled, it will break everything as you've described.
Lance, could you please indicate how to enable external version control? I thought it would be under Edit > Project Settings > Editor from what I've read elsewhere, but Editor is not there.
um... it is under Edit > Project Settings > Editor. I'm not sure why it is not there for you. You're looking in the Edit menu right?
@$$anonymous$$risten Only Unity Pro has External Version Control
Answer by qJake · Jul 16, 2010 at 10:43 PM
Already asked, already answered:
http://answers.unity3d.com/questions/13992/which-folders-in-a-unity-project-are-critical-folders
that other question is only asking about folder. Hawkeye is asking about files too. The Library folder requires file-by-file ignores.
Your answer
Follow this Question
Related Questions
Unity and source control (sourcetree) 2 Answers
Can Mecurial be used with Unity3d 3.1 2 Answers
Collaborate wants to push changes on many files I didn't edit 0 Answers
MonoDevelop doesn't load all source control folders 0 Answers
Array of objects on a MonoBehaviour script not persisting after pulling from source control 0 Answers