Why do we need version (aka source) control?
- when projects become more complex, team members need to stay up to date with changes their fellow teammates make.
- If they don’t coordinate consistently, they will face inefficiencies, bottlenecks, lost code, rework, and a lot of frustration.
- Version control mitigates bottlenecks, inefficiencies, lost code, reworks, and frustration
- How do we version control large project assets? with Git LFS!
What is git LFS?
- git LFS (large file support) enables git tracking of LARGE binary Assets in your XR projects! These include:
- 3D Models:
.fbx, .obj, .blend, etc.
- Textures and Images:
.png, .jpg, .psd, etc.
- Audio Files:
.wav, .mp3, etc.
- Videos:
.mp4, .avi, etc.
- Unity Asset Bundles:
.unity3d, .assetbundle
- tracking files with git LFS
- make sure git LFS is already installed (git lfs install)
- open terminal → navigate to the root directory of your project with:
cd </path/to/repository>
- run
git lfs track "*.<fileextension>" to add a file type for LFS tracking
- run
git add .gitattributes
- run
git commit -m "LFS-related message" to commit the .gitattributes file
What is git ignore?
- git ignore ensures that certain files are NOT tracked by Git
- when you commit to GitHub, the files specified in the .gitignore file are IGNORED
- this is very useful when we have large XR project repositories, as we can reduce clutter!
- .gitignore file syntax
- each line specifies a pattern.
- lines starting with
# are comments (not part of the specified ignored information)
- .gitignore organization within project repository
- place the
.gitignore file in the root directory of the Git repository (i.e. your XR project repository)
- root directory = top-level directory; contains ALL assets, project settings, and other files associated with your Unity project
- although additional
.gitignore files can be placed in subdirectories to apply rules locally, but we don’t have to worry about this for now
- when a
.gitignore file is committed into a repository → ignore rules are consistent across all environments and for all contributors to the project
Unity .gitignore
- default Unity .gitignore ignores:
Library — ignored bc its contents (compiled asset data, import settings, caching information) are automatically regenerated by Unity when another project contributor works on a clone of the project in the Unity editor
- ignoring this mitigates merge conflicts and reduces storage
Logs — ignored bc its contents are contributor-specific Unity logs (editor session warnings, output errors, etc. while working in the Unity editor)
- ignoring this reduces noise and unnecessary repository data
- other folders / files specific to contributors’ development environments (don’t need to be shared with others):
Temp/ — ignores temporary files generated by Unity during runtime and while editing
Obj/ — ignores stored object files (intermediate files created during the build process) specific to each build
Build/ and Builds/ — ignores output of build processes (executables) specific to each build
MemoryCaptures/ — ignores memory captures (large, specific info from debugging sessions)
*.csproj, *.sln, *.suo, *.userprefs *.user, *.unityproj, *.pidb, *.booproj — ignores files specific to contributors’ development environment (created by IDE, like Visual Studio)
/VSCodeSettings.json — vscode specific
- •
*.pidb.meta, *.pdb.meta, *.mdb, *.mdb.meta — metadata files for debugging symbols specific local builds
- remember: you can customize the Unity .gitignore it based on your project team’s needs
Initial Setup (before pushing and pulling)