【问题标题】:How to prevent files from unnecessarily changing when running a freshly cloned Cocos Creator project?运行新克隆的 Cocos Creator 项目时,如何防止文件发生不必要的更改?
【发布时间】:2020-07-06 11:42:37
【问题描述】:

如何防止 Cocos Creator 从 GIT 仓库打开新克隆的项目时不必要地更改文件?

我创建了一个新项目并选择helloworld-typescript 示例项目作为启动并运行它。之后我提交并推送了引擎自己生成的.gitignore 文件没有忽略的所有内容。

问题是,如果我删除本地存储库,再次克隆项目并运行它,GIT 中会出现一堆更改——各种.meta 文件和一些.json 文件。有没有办法防止这种情况?我可以尝试忽略所有 .meta 文件,但我担心它们可能包含一些重要数据。

运行从 GIT 存储库克隆的项目后标记为已修改的文件示例:

modified:   assets/Scene.meta
modified:   assets/Scene/helloworld.fire.meta
modified:   assets/Script.meta
modified:   assets/Script/Helloworld.ts.meta
modified:   assets/Texture.meta
modified:   assets/Texture/HelloWorld.png.meta
modified:   assets/Texture/singleColor.png.meta
modified:   project.json
modified:   settings/project.json
modified:   settings/services.json

【问题讨论】:

    标签: git cocoscreator


    【解决方案1】:

    想出了解决办法。看来问题出在行尾。

    在 GIT 中运行以下命令:

    git config core.autocrlf false
    

    它将阻止 GIT 自动执行某些操作,进而阻止 .meta.json 文件在您每次运行项目时被修改。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-02
      • 2019-04-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-28
      • 1970-01-01
      • 2019-12-26
      相关资源
      最近更新 更多