这是在 git 2.35.2 添加的一项安全检查
当你在外置磁盘操作git仓库时,可能会报一个错误,然后提示你执行代码添加当前仓库到 .gitconfig
配置中
fatal: unsafe repository ('/storage/emulated/0/my-repo.git' is owned by someone else)
To add an exception for this directory, call:
git config --global --add safe.directory /storage/emulated/0/my-repo.git
很快在新版本 git 2.35.3 考虑到有些用户有非常大的共享存储库列表,并且发现为每个存储库添加此配置很麻烦。再增加了全局取消检查的优化
具体操作,执行一行代码OK
git config --global --add safe.directory "*"
# 或
# git config --global --add safe.directory ""
https://github.com/git/git/commit/0f85c4a30b072a26d74af8bbf63cc8f6a5dfc1b8
是的!之前编译 2.35.1 都变了无用功,不过还是有收获的,起码享受了编译的乐趣