Git 忽略 Unity 项目中的 obj 文件
Git ignoring obj files in Unity project
我正在使用 git 开发一个统一项目,我使用的是在 github 上找到的 .gitignore 文件。
我不知道 gitgnore 文件的哪条规则导致了这种情况:
Git 正在忽略“projectname/Assets/objs”中的 .obj 文件。
这是.git忽略:
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/
# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/
# Asset meta data should only be ignored when the corresponding asset is also ignored
!/[Aa]ssets/**/*.meta
# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*
# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*
# 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
*.aab
*.unitypackage
# Crashlytics generated file
crashlytics-build.properties
# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*
另一个问题是:我需要跟踪这些文件吗? files to track???
不,您不需要(也不应该)跟踪 Library
文件夹。它是 Unity 的缓存数据,如果不存在会自动重新生成。您的 .gitignore
似乎正确地排除了 Library
,因此不应跟踪它 - 您确定将文件准确地放置在项目的根目录下吗?它应该与 Assets
和 Library
.
等文件夹处于同一级别
要检查您的 .gitignore
是否对未包含某些内容负责,请使用:
git check-ignore -v -- some/path/to/check
它会输出负责的规则,如果有的话。
我正在使用 git 开发一个统一项目,我使用的是在 github 上找到的 .gitignore 文件。 我不知道 gitgnore 文件的哪条规则导致了这种情况: Git 正在忽略“projectname/Assets/objs”中的 .obj 文件。
这是.git忽略:
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/
# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/
# Asset meta data should only be ignored when the corresponding asset is also ignored
!/[Aa]ssets/**/*.meta
# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*
# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*
# 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
*.aab
*.unitypackage
# Crashlytics generated file
crashlytics-build.properties
# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*
另一个问题是:我需要跟踪这些文件吗? files to track???
不,您不需要(也不应该)跟踪 Library
文件夹。它是 Unity 的缓存数据,如果不存在会自动重新生成。您的 .gitignore
似乎正确地排除了 Library
,因此不应跟踪它 - 您确定将文件准确地放置在项目的根目录下吗?它应该与 Assets
和 Library
.
要检查您的 .gitignore
是否对未包含某些内容负责,请使用:
git check-ignore -v -- some/path/to/check
它会输出负责的规则,如果有的话。