【问题标题】:fatal: unsafe repository ('/azerothcore' is owned by someone else)致命:不安全的存储库('/azerothcore' 由其他人拥有)
【发布时间】:2022-06-30 01:23:59
【问题描述】:
fatal: unsafe repository ('/azerothcore' is owned by someone else)
To add an exception for this directory, call:

        git config --global --add safe.directory /azerothcore
--
    Could not find a proper repository signature (hash) - you may need to pull tags with git fetch -t
    Continuing anyway - note that the versionstring will be set to "unknown 1970-01-01 00:00:00 (Archived)"

我在 Windows 10 上使用 git --version 2.36 在最新的主 AC 分支 (07.05) 上的 docker 桌面

甚至无法检查当前哈希Picture

我已经尝试了相关线程中建议的所有内容。即使通过在我的 .gitconfig 中添加 [safe] directory = *(我是唯一的用户,所以这并不重要)来禁用该安全功能也不能解决这个问题。

编辑:我使用docker编译,每次编译都会弹出这个,不,最近git安全更新后开始显示。

【问题讨论】:

  • 您需要确保设置该设置在 docker 内
  • 这主要是一个 Docker 问题,真的。当您在 Docker 中启动虚拟主机时,您可以控制其虚拟文件系统的布局。这包括您的主目录(包含您的 --global Git 配置)是否出现在虚拟主机内,如果出现,它出现在哪里。虚拟主机也有虚拟用户,所以虚拟用户可能有不同的主目录。如果您愿意,您可以将 your 主目录设为 their 主目录,但这通常是不明智的。因此,您最终需要为虚拟主机中的虚拟 Git 用户配置 --global
  • 一旦你在这里完成了所有 Docker 端的项目,请注意你可能不想声明 every 目录是安全的,而只想声明 /azerothcore 目录。这样一来,您的虚拟主机就不会暴露于新的安全检查所针对的安全问题。

标签: git azerothcore


【解决方案1】:

这可能不是最好的方法,但我只是在调用bash acore.sh compiler build之前修改了apps\docker\docker-build-prod.sh以添加git config --global --add safe.directory /azerothcore

【讨论】:

  • 确实解决了!感谢大家的帮助和信息。但是 git 现在想要提交对该文件的更改,如果我尝试将其添加到 .gitignore 它想要提交 .gitignore 本身。我试过.git/info/exclude,但这并没有改变任何东西。
【解决方案2】:

以下命令在 Windows 10 上对我有用。 git config --global --add safe.directory 例如: git config --global --add safe.directory d:/Dev/project1

【讨论】:

    猜你喜欢
    • 2022-06-13
    • 1970-01-01
    • 2010-10-13
    • 1970-01-01
    • 2019-08-24
    • 1970-01-01
    • 1970-01-01
    • 2014-12-03
    • 2021-07-31
    相关资源
    最近更新 更多