git fatal: detected dubious ownership in repository at '/www/wwwroot/

  • 内容
  • 评论
  • 相关
git 拉取报错git fatal: detected dubious ownership in repository at '/www/wwwroot/
网上全是用这句,git config --global --add safe.directory '*'1
其实是不管用的 【应该使用】
sudo git config --system --add safe.directory '*'

具体原因是因为git 2.31版本引入了安全目录,拉取的用户与文件所有用户不一致就会这样报错,正规方式应当使用同一个用户去拉取就不会有问题了,但是这里由于一些原因不能修改文件所有权,又必须要用root去拉取,所以使用sudo git config --system --add safe.directory '*'就可以了

评论

0条评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注