Unity Git-忽略库 [英] Unity Git - Ignore Library

查看:188
本文介绍了Unity Git-忽略库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去两天,我们一直在Mac和PC之间的项目中尝试使用Unity设置Git.我们已经可以正常工作了,但是在Library/AssetDatabase3中,元数据和冲突仍然存在问题.

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.

我们在.gitignore文件中获得了整个Library文件夹,但是由于某些原因,似乎其中的某些文件没有被忽略.

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.

有人知道为什么忽略"文件不会完全忽略图书馆"文件夹吗?与冲突有关的问题似乎来自assetDabase文件.对Mac和PC之间的良好工作流程有何建议?

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?

推荐答案

我最近遇到了这种情况,发现问题是我将整个Unity项目放在存储库中的文件夹中,而gitignore正在使用

I recently had this happen to me and found that the issue was that I had my entire Unity project in a folder in the repo, and the gitignore was using the syntax of

/[Ll]ibrary/

仅搜索与gitignore本身处于同一级别的文件夹,而

which only searches folders at the same level as the gitignore itself, whereas

[Ll]ibrary/

没有前导/也会搜索所有子文件夹.删除前导/导致它正确地忽略了库.希望这会有所帮助!

without the leading / searches all subfolders as well. Removing the leading / led it to properly ignore the Library. Hope this helps!

应该注意的是,如果由于某种原因碰巧在其他地方使用了该名称,此解决方案也会导致它忽略任何其他名为Library的文件夹.

It should be noted that this solution will also cause it to ignore any other folders named Library, if you happen to be using that name elsewhere for some reason.

这篇关于Unity Git-忽略库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆