最近,當我在 Android Studio 中打開 git 專案時,收到此錯誤:
Error updating changes: Unsafe repository (`project name` is owned by someone else). To add an exception to this directory, call : git config --global --add safe.directory ...
我知道使用提到的命令列我可以擺脫這個,但是沒有任何自動解決方案嗎?
我有很多專案,我時不時會面對這個!
uj5u.com熱心網友回復:
首先檢查你的 Git 版本:
git version
如果是最近的 2.35.2 或 2.36,則需要設定safe.directory設定,因為CVE-2022-24765。
git config --global --add safe.directory 'Path/To/Repo'
或者您可以禁用它,但首先要確保您了解它存在的原因。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/466869.html
下一篇:需要從拉取請求中洗掉多個提交
