0


git报错fatal: detected dubious ownership in repository at

git报错

在git上执行
git branch
fatal: detected dubious ownership in repository at ‘/home/你的用户名/cam/code’
To add an exception for this directory, call:

git config --global --add safe.directory /home/你的用户名/cam/code

这个一般是权限不足导致的,有两种解决方式:
1.sudo su进入到root权限

sudo su

然后输入你的密码
2.这个错误提示表明在您的Git仓库中发现了一个可疑的文件夹,该文件夹的所有权可能已被恶意篡改。为了避免潜在的安全问题,Git阻止执行某些操作。

根据错误提示,您可以通过调用以下命令来为该目录添加一个例外:

git config --global --add safe.directory /home/你的用户名/cam/code
该命令会将/home/hpyd/camera/ipccode添加到全局安全目录列表中,以便Git能够正常操作该目录。

请注意,如果您不确定该目录是否受到威胁,您应该先检查该目录的所有权和权限设置,确保它们是正确的。如果您相信该目录是安全的,您可以通过使用上述命令来添加一个例外,以便Git正常工作。

git config --global --add safe.directory /home/你的用户名/cam/code

建议使用第一种

标签: git

本文转载自: https://blog.csdn.net/qq_44648715/article/details/135618964
版权归原作者 追_求_卓_越 所有, 如有侵权,请联系我们删除。

“git报错fatal: detected dubious ownership in repository at”的评论:

还没有评论