在创建Unity3D后,VS和Unity会生成很多不需要同步的文件和文件夹,包括在Windows与Mac系统中,有时候也会自动生成一些多余的文件和文件夹。就要使用.gitignore文件中的规则来过滤这些不必要的文件和文件夹,经过整理和修改,这里给出一个较为完善的.gitignore配置文件,具体内容如下,在每次创建新的仓库时,可以使用这个.gitignore规则进行过滤。在Mac系统中,以英文句号开头的文件为隐藏文件,如果要显示隐藏文件,可以按下快捷键Command + Shift + .
。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| # Unity3D generated file and folders [Ll]ibrary/ [Tt]emp/ [Oo]bj/ [Bb]uild/ [Bb]uilds/ [Ll]ogs/ [Uu]serSettings/ [Mm]emoryCaptures/ /ignore.conf *.private *.private.meta ^*.private.[0-9]+$ ^*.private.[0-9]+.meta$ .collabignore **/Assets/AddressableAssetsData/*/*.bin* **/assets/addressableassetsdata/*/*.bin* **/Assets/StreamingAssets/aa.meta **/assets/streamingassets/*/aa/*
# Unity3D generated PlasticSCM flies /Assets/Plugins/PlasticSCM* /assets/plugins/PlasticSCM*
# Asset store tools plugin [Aa]ssets/AssetStoreTools* **/assets/assetstoretools
# Visual Studio cache directory .vs/
# Gradle cache directory .gradle/
# Autogenerated VS/MD/Consulo solution and project files 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
# Builds *.apk *.unitypackage
# Crashlytics generated file crashlytics-build.properties
# Mac files .DS_Store*
# Windows files Thumbs.db Desktop.ini
|