Skip to content

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?

@leve1997

This comment has been minimized.

Copy link

leve1997 commented Mar 5, 2019

Can you use the same file for 2d projects?

@Suyashtnt

This comment has been minimized.

Copy link

Suyashtnt commented Jun 20, 2019

Can you use the same file for 2d projects?

yes you can

@Kenshokram

This comment has been minimized.

Copy link

Kenshokram commented Jan 10, 2020

If you rename the folder to Unity, that project in the unity hub will then be called "Unity", which isn't great. Is there a way to go around this or is the best solution to just write the name of the project in the ignore on every new project?

@FullStackForger

This comment has been minimized.

Copy link
Owner Author

FullStackForger commented Mar 13, 2020

RE: on meta files. *.meta files are committed. we are only ignoring *.pidb.meta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.