Skip to content

Instantly share code, notes, and snippets.

@mduheaume
Created January 28, 2012 17:12
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save mduheaume/1695068 to your computer and use it in GitHub Desktop.
Save mduheaume/1695068 to your computer and use it in GitHub Desktop.
Git ignore file for unity projects
Temp/
Library/
obj/
*.svd
!Library/*.asset
!Library/AssetImportState
!Library/AssetVersioning.db
!Library/BuildPlayer.prefs
!Library/ScriptMapper
!Library/assetservercachev3
!Library/expandedItems
!Library/guidmapper
!Library/unity default resources
!Library/unity editor resources
/Project/Project.userprefs
/Project/Assembly-CSharp.csproj
/Project/Assembly-CSharp.pidb
/Project/Assembly-CSharp-Editor.csproj
/Project/Assembly-CSharp-Editor.pidb
/Project/Assembly-CSharp-Editor-vs.csproj
/Project/Assembly-CSharp-firstpass.csproj
/Project/Assembly-CSharp-firstpass.pidb
/Project/Assembly-CSharp-firstpass-vs.csproj
/Project/Assembly-CSharp-vs.csproj
/Project/Assembly-UnityScript-firstpass.pidb
/Project/Assembly-UnityScript-firstpass.unityproj
/Project/Assembly-UnityScript-firstpass-vs.unityproj
/Project/Project.suo
@ashclarke
Copy link

@mduheaume

Is there a reason you keep the files in the library folder, that are not .asset files too?

I've seen other examples where they ignore these e.g.

http://www.chrisdanielson.com/2011/06/04/unity3d-projects-version-control-git/

And others where they don't.

Currently for library, I have:

Library/*
!Library/*.asset

It's all a bit confusing for newbies! :]

@robertocaldas
Copy link

Besides what ashclarke noticed, also there's an error in your .gitignore:

In order to "unignore" stuff inside the library, you'd have to use Library/* instead of Library/. Right now you are just ignoring the whole Library.

More explanation at http://stackoverflow.com/questions/5533050/gitignore-exclude-folder-but-include-specific-subfolder

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