git踩坑

  • 错误提示('fatal: detected dubious ownership in repository at')
PS Microsoft.PowerShell.Core\FileSystem::\\mega\xchang\classification> git remote add origin https://gitee.com/me095/post-doc-abnormally-detection.git
fatal: detected dubious ownership in repository at '//mega/xchang/classification'
'//mega/xchang/classification' is owned by:
        'S-1-5-21-3932322877-3755357687-4209837943-1034'
but the current user is:
        'S-1-5-21-3742248397-3217600930-3715186629-1004'
To add an exception for this directory, call:

        git config --global --add safe.directory '%(prefix)///mega/xchang/classification'
  • 解决方法
  1. 先运行下面代码(Silence all warnings related to git's safe.directory system.)
git config --global --add safe.directory '*'
posted @ 2024-02-07 18:03  Elina-Chang  阅读(93)  评论(0)    收藏  举报