Unity Git - Ignore Library

╄→гoц情女王★ 提交于 2019-12-24 13:55:23

问题


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 the metadata and conflicts in Library/AssetDatabase3.

We got the whole Library folder in the .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 actually changed, there will be list of hundreds of metadata. Again coming from Library.

Any idea why Library folder doesn't 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?


回答1:


Even after you have added the files to your gitignore, Git may still know about the files you added.

Try committing your actual changes and then running the following command.

git rm -r --cached .
git add .
git commit -m "fixed untracked files"



回答2:


Strongly recommend that you set up your Git repo according to this guide.

You should be using Unity's "meta" files for asset serialization, which will allow you to ignore the Library folder in version control.

The meta files include asset import settings, GUID information, and so on. This information is normally stored in the Library folder, which will be automatically generated by each computer as it imports assets. The data that's included in meta files is important and must be consistent between computers; the rest of the information in Library is not necessarily consistent, and will cause unnecessary conflicts in version control.



来源:https://stackoverflow.com/questions/32783295/unity-git-ignore-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!