0

I'm working on a unity project with git and i'm using a .gitignore file found on github. I don't recognize which rule of the gitgnore file make this happen: Git is ignoring the .obj files in "projectname/Assets/objs".

This is the .gitignore:

# 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/*

The other question is: do I need to track these files? files to track???

4
  • 1
    If those are compiler object files, you definitely don't want to track them. .obj is usually an extension for compiler object files on Windows systems.
    – bk2204
    Commented Nov 27, 2020 at 19:18
  • Why is it an issue its not tracking obj files as they are remade
    – BugFinder
    Commented Nov 27, 2020 at 19:26
  • Do you ignore them in your global gitignore?
    – derHugo
    Commented Nov 28, 2020 at 8:44
  • @bk2204 In this context, the obj refers to a Wavefront .obj file containing plaintext geometry data
    – Immersive
    Commented Nov 29, 2020 at 13:21

1 Answer 1

1

No, you don't need to (and shouldn't) track Library folder. It's Unity's cached data which regenerates automatically if not present. Your .gitignore seems to exclude Library correctly, so it shouldn't be tracked - are you sure you placed the file exactly at the root of the project? It should be on the same level as folders such as Assets and Library.

To check if your .gitignore is responsible for not including something, use this:

git check-ignore -v -- some/path/to/check

It will output the responsible rule, if any.

Not the answer you're looking for? Browse other questions tagged or ask your own question.