UE4在MacOS上将Commit.gitdeps.xml设为Git LFS文件的潜在弊端

问题背景

近期 Engine/Build/Commit.gitdeps.xml 添加到Git LFS文件后(操作过程见下文的方法1),出现了一个奇怪的问题------git 拉取后 Engine/Build/Commit.gitdeps.xml 成为3行的LFS指针文件,文件内容如图2,文件大小是133B ,导致后续的 git dependencies 失败,报错如日志3。这个问题只出现在iOS的构建机上。

在.gitattributes 文件中添加如下文本,即可以将 Engine/Build/Commit.gitdeps.xml 置入到LFS文件的行列中了。

Engine/Build/Commit.gitdeps.xml filter=lfs diff=lfs merge=lfs -text

(方法1)

(图2)

Failed to read '/Users/mygame/EngineSource/Engine/Build/Commit.gitdeps.xml': System.InvalidOperationException: There is an error in XML document (1, 1). ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

(日志3)

真相

最小复现操作指令如图4的[1]~[4] 步骤,由于 chmod 777 对 Commit.gitdeps.xml 进行了处理,导致此文件被git status 识别为变更。

(图4)

此时 git reset --hard HEAD ,就会损坏,因为lfs此时被卸载了。损坏后, git dependencies 无法正常工作,于是报错如日志3。

解决方法

下面两个思路中择其一就可以了。

1、把 lfs 安装上,然后 git lfs pull

2、让 该文件 重新恢复( lfs安装上之后 git checkout HEAD -- 该文件),撤销 chmod 的影响。

相关推荐
一个响当当的名号11 小时前
lectrue4 数据库存储
ue4
sunnyday042619 小时前
Spring Boot 日志配置详解:log4j2.xml 的完整配置指南
xml·spring boot·log4j
熊出没21 小时前
关于MyBatis Mapper 接口与 XML 映射机制的分析
xml·microsoft·mybatis
她说..2 天前
FIND_IN_SET()方法
xml·java·spring boot
北辰当尹2 天前
xml基础
android·xml
陈友松3 天前
UE5运行时操作撤销系统插件
ue5·ue4·运行时回退撤销
北冥没有鱼啊3 天前
UE5 离谱问题,角色动画不播放
游戏·ue5·ue4·游戏开发·虚幻
WinstonJQ5 天前
AirSim无人机仿真入门(一):实现无人机的起飞与降落
python·机器人·游戏引擎·ue4·无人机
qqqahhh6 天前
xml文件的动态化配置,导入
xml·spring·springboot
吴声子夜歌6 天前
Maven——pom.xml详解
xml·java·maven