Skip to content

Instantly share code, notes, and snippets.

@jase-perf
Last active July 30, 2026 07:27
Show Gist options
  • Select an option

  • Save jase-perf/1c24138a68498f7117052b046ca5a215 to your computer and use it in GitHub Desktop.

Select an option

Save jase-perf/1c24138a68498f7117052b046ca5a215 to your computer and use it in GitHub Desktop.
Perforce Universal GameDev p4ignore - Unreal, Unity, Godot, Blender, Maya, and more DCC tools (please comment with suggestions)
# =============================================================================
# UNIVERSAL P4IGNORE — Unreal · Unity · Godot + common DCC / IDE tooling
# =============================================================================
# Point P4IGNORE at this file (e.g. p4 set P4IGNORE=.p4ignore ) and place it at
# your workspace root. Designed to need no per-project editing for common layouts.
# Safety-first: it aims never to ignore a file you actually track. If a rule ever
# catches something you DO want in Perforce, add a !path line right after it.
#
# -----------------------------------------------------------------------------
# P4IGNORE SYNTAX (why the patterns below look the way they do)
# /foo leading slash -> anchored to THIS file's directory (root)
# foo/ trailing slash -> a DIRECTORY only, never a file of that name
# foo/ no slashes -> matches at ANY depth, including root
# /*/foo/ single * -> exactly ONE level deep (* never crosses '/')
# **/foo/ double star -> depth >= 1, and SKIPS ROOT; for "all depths
# incl. root" use a bare foo/ (that is why Saved/ below is bare)
# A/b/ mid-slash, no leading slash -> FLOATS to any depth; add a leading
# slash to anchor it to the root
# !foo leading '!' -> re-include (un-ignore) — works even under an
# already-ignored directory
# [Ll] character classes are NOT supported -> split into two lines
# ? NO single-character wildcard -> '?' matches a literal '?'
#
# BINARY PHILOSOPHY:
# Perforce versions binaries natively, and you usually WANT them tracked — sync
# prebuilt editor binaries, DLLs, source art and built data instead of making
# every user recompile. So this file TRACKS binaries and ignores only the
# specific generated files inside those trees. Do NOT add blanket binary rules
# (*.dll, Binaries/*, SourceArt/*.png, ...) or you will stop tracking files you need.
#
# LAYOUT ASSUMPTION: an engine project sits at the workspace root or ONE level
# below it. Deeper nesting may need a per-repo tweak (add another /*/… line).
#
# Assembled from community Unreal / Unity / Godot ignore templates and a
# DNEG-derived Unreal + Perforce template; verified against the P4 client.
# =============================================================================
###############################################################################
# SHARED — Version control cross-pollination
###############################################################################
.git/
.gitignore
.gitattributes
.gitmodules
.tgitconfig
.collabignore
###############################################################################
# SHARED — OS-generated files
###############################################################################
.DS_Store
.DS_Store*
._*
.Spotlight-V100
.Trashes
Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
###############################################################################
# SHARED — IDE: Visual Studio
###############################################################################
.vs/
# Solution/project files: anchored root+1 only. Unreal REGENERATES root .sln,
# but tracks .csproj under Engine/Source/Programs/** — so never ignore bare.
/*.sln
/*/*.sln
/*.slnx
/*/*.slnx
/*.csproj
/*/*.csproj
/*.vcxproj
/*/*.vcxproj
*.suo
*.opensdf
*.sdf
*.mdb
*.opendb
*.VC.db
*.VC.opendb
*.user
*.userprefs
*.pidb
*.booproj
*.svd
# .pdb: ignored by default (debug symbols). Exception a specific one if your
# team versions prebuilt-binary symbols. `!*.pdb/` keeps a dir literally named .pdb
*.pdb
!*.pdb/
*.pdb.meta
*.pidb.meta
*.mdb.meta
# obj/ = C#/VS build intermediate (any depth; no engine tracks a source dir 'obj')
obj/
Obj/
**/launchSettings.json
*.csproj.cache
*.csproj.nuget.*
*.csproj.AssemblyReference.cache
*.csprojAssemblyReference.cache
# DO NOT ignore *.csproj.props — shared build configuration, must be tracked
!*.csproj.props
###############################################################################
# SHARED — IDE: JetBrains (Rider / CLion / etc.)
###############################################################################
.idea/
!.idea/runConfigurations
*.DotSettings.user
###############################################################################
# SHARED — IDE: VS Code
###############################################################################
# Some teams intentionally version shared .vscode config; uncomment the !lines.
.vscode/
# !.vscode/launch.json
# !.vscode/tasks.json
# !.vscode/extensions.json
*.code-workspace
###############################################################################
# SHARED — Perforce local config
###############################################################################
.p4config
p4config.txt
.p4config.txt
.p4sync.txt
.p4ignore.local
###############################################################################
# SHARED — Python (tooling / build scripts)
###############################################################################
__pycache__/
*.pyc
*.egg-info/
.venv/
###############################################################################
# SHARED — AI / LLM tooling
###############################################################################
.mcp.json
.ai/
###############################################################################
# SHARED — Android / Gradle / Firebase (mobile game builds)
###############################################################################
.gradle/
crashlytics-build.properties
###############################################################################
# SHARED — Xcode user data (iOS/macOS builds — all engines)
###############################################################################
*.xcworkspace/xcuserdata/
*.xcodeproj/xcuserdata/
*.xcodeproj/project.xcworkspace/xcuserdata/
###############################################################################
# SHARED — Packaged application build OUTPUTS (regenerable end products)
# NOTE: these are final packages, not source binaries. Exception any you archive.
###############################################################################
*.apk
*.aab
*.ipa
*.dSYM.zip
###############################################################################
###############################################################################
## UNREAL ENGINE (tested against UE source + Horde)
###############################################################################
###############################################################################
# --- Core generated directories ---
# Engine-shipped demo content (Samples / FeaturePacks / Templates) — ROOT ONLY.
# The /*/ one-level variants were dropped: they also caught tracked GAME content
# like Content/Samples/ and Content/Templates/. If you sync full engine SOURCE one
# level down (e.g. UnrealEngine/Samples/), add that path explicitly yourself.
/Samples/
/FeaturePacks/
/Templates/
# Saved / Intermediate: pure generated content, no legit tracked dir by these
# names in UE. Bare = all depths incl. root (correct; `**/` would skip root).
Saved/
Intermediate/
# Derived Data Cache (bare = all depths). Re-include a genuine source-tree DDC.
DerivedDataCache/
!**/Source/**/DerivedDataCache/
# Unreal workspace / dependency config
.ue4dependencies
.ugs/
# Crash reports
crashinfo--*
# Linux/Qt project files (UBT-generated); anchored root+1 so a hand-authored,
# tracked Qt tool project (Tools/QtEditor/QtEditor.pro) isn't eaten.
/*.pro
/*/*.pro
/*.pri
/*/*.pri
*.kdev4
# Obj-C / Swift build maps + debug bundles under Binaries
*.hmap
Binaries/**/*.dSYM
Binaries/**/*.dsym
# Local builds — but keep the UGS archive workspace nested inside it
# (a re-include under an already-ignored directory, which P4 supports).
/LocalBuilds/
!ArchiveForUGS-Perforce/
# --- Engine-specific generated files (Engine/ at root or nested) ---
# UnrealBuildTool logs & config
Engine/Programs/UnrealBuildTool/*.txt
Engine/Programs/UnrealBuildTool/Log*.json
Engine/Programs/UnrealBuildTool/Log*.uba
Engine/Programs/UnrealBuildTool/Trace*.uba
*.uatbuildrecord
# Build receipts
Engine/Build/Receipts/
# C# program intermediates & saved folders
Engine/Source/Programs/*/obj/
Engine/Programs/*/Saved/
# .NET build artifacts (generated), but KEEP the ThirdParty/DotNET shipped ones
*.deps.json
*.runtimeconfig.json
**/bin/**/ref/
# Re-include sidecars for ANY tracked binary under a Binaries/ dir (plugins, game,
# Restricted, Engine). Both forms cover the `**/` root-skip: files directly in the
# dir AND in subfolders. Sidecars in bin//obj/ (build junk) stay ignored.
!**/Binaries/**/*.deps.json
!**/Binaries/*.deps.json
!**/Binaries/**/*.runtimeconfig.json
!**/Binaries/*.runtimeconfig.json
# Test coverage mapping files
.msCoverageSourceRootsMapping_*
CoverletSourceRootsMapping_*
# Documentation-tool output
Engine/Binaries/DotNET/UnrealBuildTool.xml
Engine/Binaries/DotNET/AutomationScripts/BuildGraph.Automation.xml
# UBT-generated version / linker export files (specific, inside Binaries)
Engine/Binaries/**/*.version
Engine/Binaries/**/*.exp
# Swarm local save files
Engine/Binaries/DotNET/SwarmAgent.DeveloperOptions.xml
Engine/Binaries/DotNET/SwarmAgent.Options.xml
# HoloLens WMRInterop autogenerated files
Engine/Source/ThirdParty/WindowsMixedRealityInterop/packages/
Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/Generated Files/
Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/x64/
Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInteropHoloLens/ARM64/
Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInterop/x64/
Engine/Source/ThirdParty/WindowsMixedRealityInterop/MixedRealityInterop/ARM64/
###############################################################################
###############################################################################
## UNITY (generic names anchored + case-split for P4 & UE safety)
###############################################################################
###############################################################################
# Generic dir names are anchored to root+one-level so they can't reach into
# Unreal engine source. [Xx] classes are split (P4 has no char classes).
# Asset import cache / compiled scripts / shader cache (can be many GB)
/Library/
/library/
/*/Library/
/*/library/
# Runtime temp (exists only while the editor runs)
/Temp/
/temp/
/*/Temp/
/*/temp/
.utmp/
# Editor / shader-compiler logs
/Logs/
/logs/
/*/Logs/
/*/logs/
# Per-user editor prefs, layouts, search indices
/UserSettings/
/usersettings/
/*/UserSettings/
/*/usersettings/
# Unity-generated C# project files (root+1; Unreal tracks nested .csproj)
*.unityproj
# Editor OBJ exports & Consulo/MonoDevelop leftovers
ExportedObj/
/*/ExportedObj/
.consulo/
# Profiler / diagnostics (can be huge, may contain sensitive data)
/MemoryCaptures/
/memorycaptures/
/Recordings/
/recordings/
# Unity crash file (written at project root; anchored so it can't eat a tracked doc)
/sysinfo.txt
mono_crash.*
# NOTE: no bare "*.log" — the /Logs/ rules above already catch Unity's real logs,
# and a bare *.log eats tracked files like changelog.log or golden test logs.
# Package/import outputs
*.unitypackage
*.unitypackage.meta
# TestRunner-generated scenes
InitTestScene*.unity*
/Assets/InitTestScene*.unity*
# Rider plugin auto-installed by Unity
/Assets/Plugins/Editor/JetBrains*
# Asset Store Tools (downloaded on demand, not project content)
/Assets/AssetStoreTools/
# --- Addressables: source config (Assets/AddressableAssetsData/) IS tracked;
# only the generated binary output is ignored. Anchored to Assets/ (leading
# slash = anchored to root). ---
/ServerData/
/Assets/StreamingAssets/aa/
/Assets/StreamingAssets/aa.meta
/Assets/AddressableAssetsData/link.xml
/Assets/AddressableAssetsData/link.xml.meta
/Assets/AddressableAssetsData/*/*.bin
/Assets/AddressableAssetsData/*/*.bin.meta
/Assets/Addressables_Temp/
# Visual Scripting auto-generated caches (source config is kept)
/Assets/Unity.VisualScripting.Generated/VisualScripting.Flow/UnitOptions.db
/Assets/Unity.VisualScripting.Generated/VisualScripting.Flow/UnitOptions.db.meta
# Auto-generated Assets caches
/Assets/SceneDependencyCache/
# Blender import leftovers (Unity auto-imports .blend; .blend1 backup is junk)
*.blend1.meta
# NOTE: Unity BUILD OUTPUT (Build/, Builds/) is intentionally NOT ignored here.
# Those names collide with Unreal's tracked Build/ and Engine/Build/ at the same
# depth, so a universal file can't safely ignore them. Unity-only teams: add
# /Build/
# /Builds/
# per-repo, or (recommended) put build output in a separate depot/stream.
###############################################################################
###############################################################################
## GODOT (Godot 4 + legacy Godot 3 Mono)
###############################################################################
###############################################################################
# Godot 4+ engine cache & platform hint
.godot/
.nomedia
# Godot 4.2+ native extension copy
~*.dll
# Godot 3 import cache
.import/
# Export CONFIG with secrets (export_presets.cfg IS tracked; these are not)
export.cfg
export_credentials.cfg
# Imported translations (generated from CSV)
*.translation
# Godot Mono (C#) generated
# NOTE: dropped legacy Godot-3 "data_*/" — it collides with common data-driven
# game folders (data_tables/, Content/data_driven/). Godot 4 uses .godot/ anyway.
.mono/
mono_crash.*.json
###############################################################################
###############################################################################
## DCC AUTOSAVE / BACKUP FILES
## Scope: autosave/backup only — the ones that commonly cause P4 noise.
## Extension/dir-specific on purpose, to avoid catching real project files.
###############################################################################
###############################################################################
# Blender
*.blend1
*.blend2
*.blend@
untitled.blend
# Autodesk Maya
*.ma.swatches
*.mb.swatches
*_incrementalSave_*.ma
*_incrementalSave_*.mb
incrementalSave/
# (dropped Maya "scenes/edits/": a mid-slash pattern floats to any depth, and
# "scenes/" is a common Unity/Godot dir — it would eat e.g. Assets/scenes/edits/)
.mayaSwatches/
# Autodesk 3ds Max
*.max.bak
autoback/
MaxStart.max
# Cinema 4D
*.c4d.zip
*.c4d~
# Houdini
*.hip.bak
*.hipnc.bak
*.hiplc.bak
# ZBrush
*.ZTL.bak
*.ZPR.bak
# QuickSave: scoped to ZBrush extensions — a bare "QuickSave*" also eats source
# files like QuickSaveSystem.cs and the popular Unity "QuickSave" asset.
QuickSave*.ZPR
QuickSave*.ZTL
# Substance Painter / Designer
*.spp.bak
*.sbs.bak
*.sbsar.bak
# Adobe Creative Suite (full extensions to avoid false matches)
*.psd~
*.ai~
*.indd~
*.fla~
*.aep~
*.prproj~
Adobe After Effects Auto-Save/
Adobe Premiere Pro Auto-Save/
# (dropped "Photoshop Temp*": too broad — matched e.g. "Photoshop Template.psd";
# PS scratch/temp files normally live on the scratch disk, not the versioned tree)
# Pro Tools
*.ptx~
*.ptf~
Session File Backups/
# Reaper
*.rpp-bak
*.rpp~
# Logic Pro
*.logic/Alternatives/
*.logic/Backups/
# Cubase / Nuendo
*.cpr.bak
*.npr.bak
# Ableton Live
*.als~
# FMOD
*.fspro.bak
*.fspro~
# Wwise
*.wproj.bak
*.wsettings.bak
###############################################################################
# SHARED — Generic temp / editor swap files (keep last; broad but low-risk)
###############################################################################
*.tmp
*.temp
*.swp
*~
# UE packaging load-order dir (usually regenerated). If your team uses pak
# load-order optimization and COMMITS its GameOpenOrder file, re-include it:
# !Build/*/FileOpenOrder/
FileOpenOrder/
@jase-perf

Copy link
Copy Markdown
Author

@mrsteyk Thanks so much! You're totally right about the Logs files as well as the other Unity ignores being too broad.
I just updated to make the Unity ignore paths only match at the root or one folder deep in the workspace, so it won't match those other files.
I also added the Trace*.uba files you mentioned.

If you're able to test it out and let me know if it works that would be great, but I appreciate your input either way.
I really appreciate the feedback! It helps a lot!

@jase-perf

Copy link
Copy Markdown
Author

I've made some significant changes to this to add a lot more comments and be more careful with how broad some of the ignore statements can be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment