Instantly share code, notes, and snippets.

Embed
What would you like to do?
.gitignore for Unity3d project
###
# Unity folders and files
###
[Aa]ssets/AssetStoreTools*
[Bb]uild/
[Ll]ibrary/
[Ll]ocal[Cc]ache/
[Oo]bj/
[Tt]emp/
[Uu]nityGenerated/
# file on crash reports
sysinfo.txt
# Unity3D generated meta files
*.pidb.meta
###
# VS/MD solution and project files
###
[Ee]xportedObj/
*.booproj
*.csproj
*.sln
*.suo
*.svd
*.unityproj
*.user
*.userprefs
*.pidb
.DS_Store
###
# OS generated
###
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
@FullStackForger

This comment has been minimized.

Copy link
Owner Author

FullStackForger commented Mar 7, 2015

Good response on stackoverflow http://stackoverflow.com/a/18225479

@unrelentingfox

This comment has been minimized.

Copy link

unrelentingfox commented Jan 18, 2018

You have "*.pidb.meta" but I don't think that matches any files in my unity project. Shouldn't it just be "*.meta" or should I actually commit some meta files?

@SteveDAC

This comment has been minimized.

Copy link

SteveDAC commented Jan 20, 2018

Shouldn't it just be "*.meta" or should I actually commit some meta files?

You absolutely do need to commit .meta files!

@MiniMAKERINO

This comment has been minimized.

Copy link

MiniMAKERINO commented Jul 22, 2018

Newbie here, will this work for collaboration between mac and PC?

@kafoso

This comment has been minimized.

Copy link

kafoso commented Dec 27, 2018

As mentioned in this comment: https://www.youtube.com/watch?v=qpXxcvS-g3g&lc=UgymTHStHTb7DKyayRR4AaABAg

You probably want to revise the .gitignore change. The removal of the starting slash will match any folder with those names absolutely anywhere, and that is not what you want. So either (A) "/*/[Ll]ibrary/" or - for this specific case and more accurately in general - (B) use "/Example Game Project/[Ll]ibrary/", where "Example Game Project" is of course replaced by the name of the folder, you are using. Additionally, I'll recommend always naming this very folder simply "Unity". The repository name and README.md file should contain the necessary information for your project. This also means you can largely copy the same .gitignore between different Unity projects.

I.e.:

  1. Rename folder "Example Game Project" to "Unity" (mv Example\ Game\ Project Unity).
  2. Change corresponding lines in .gitignore to:
/Unity/[Aa]ssets/AssetStoreTools*
/Unity/[Bb]uild/
/Unity/[Ll]ibrary/
/Unity/[Ll]ocal[Cc]ache/
/Unity/[Oo]bj/
/Unity/[Tt]emp/
/Unity/[Uu]nityGenerated/
@theTcube

This comment has been minimized.

Copy link

theTcube commented Feb 1, 2019

Should we commit all the meta files along with other stuffs or should we just skip them?

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