- Home /
Unity Git - Ignore Library
Hi, we have been trying to setup Git with Unity past two days on our project between Mac and Pc. We got it kinda working, but we still have issues with metadata and conflicts in Library/AssetDatabase3. We got whole Library folder in .gitignore file but for some reason it seems some files in it are not ignored. We will also get during commits huge list of metadata instead of only seeing changes on files which actualy changed, there will be list of hundreds of metadata. Again coming from Library.
Any idea why Library folder doesnt get full ignored with ignore file ? The issue with conflicts seems to be coming from assetDabase file. Any suggestions for good workflow between Mac and Pc ?
Thanks
.gitignore file
#For Mac developers
# Unity generated #
# =============== #
Temp/
obj/
Build
Library/
# ===================================== #
# Visual Studio / MonoDevelop generated #
# ===================================== #
ExportedObj/
*.svd
*.userprefs
*.csproj
*.pidb
*.suo
*.sln
*.user
*.unityproj
*.booproj
*.orig
*.app
*.exe
*.*_data
Build/iOS
Build/android
*.[od]
# ============ #
# OS generated #
# ============ #
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
$$anonymous$$ind of hard to tell without seeing your gitignore. Ignoring Library does work...
I started out with this: https://github.com/github/gitignore/blob/master/Unity.gitignore
Answer by sys12 · Sep 25, 2015 at 03:20 PM
try:
git rm -r --cached .
git add .
git commit -m "blablabla"
,if you think your .gitignore file is good and not working.
http://stackoverflow.com/questions/11451535/gitignore-not-working
hi, this unfortunately didnt work for me, actualy it messed up whole Unity ( crashing on every start up ) and i had to roll back to old commit.
One of the answers at that link mention that leading or trailing spaces or tabs cause problems. It might just be the formatting here, but there is at least one space before every line on OP's file. $$anonymous$$ight want to verify that that isn't the case in your actual file.
Answer by 3DDean · Sep 25, 2015 at 03:15 PM
The meta files are not in the library. They reside in the Assets folder and if you have just setup git to Unity the meta files with be tracked. You should just have to add them all to the file and add some comment to them. Then they will go away. At least that's what happened when i added git a 2 days ago. the .meta folder will be created by unity every time you create a new file. Also got to edit > project settings > editor > version control and set it to visible meta files. They are marked as hidden otherwise. So you should be able to see them if you have a view hidden files on in your OS.
Your answer
Follow this Question
Related Questions
SourceTree Hangs (not responding) with Unity Large Project 1 Answer
How to share a unity project between Mac & windows on GitHub 1 Answer
.gitignore not ignoring Library. What's the correct way to do it? 1 Answer
Ignoring Library/metadata with Unity4/Github/Win8x64 1 Answer
Make git ignore *_Data/ build output 1 Answer