Git-我应该如何处理目录所有权更改



我最近在电脑上重新安装了Windows。当我试图在我的另一个驱动器上的工作区中使用Git时,由于用户ID不匹配,它会发出警告:

max@DESKTOP-EA1LBGP MINGW64 /d/Documents/Software/development-documentation
$ git status
warning: 'D:/Documents/Software/development-documentation' is owned by:
'S-1-5-21-2274877621-3312131611-2141727559-1001'
but the current user is:
'S-1-5-21-772685654-744443855-490602743-1001'
fatal: detected dubious ownership in repository at 'D:/Documents/Software/development-documentation'
To add an exception for this directory, call:
git config --global --add safe.directory D:/Documents/Software/development-documentation

用户名max-和以前一样,但我猜Gitbash在Windows安装中使用了一些东西来确定底层用户ID。

我应该更改用户ID以匹配以前的用户ID吗?如果是,我该怎么做?这样做有什么副作用吗?

还是应该将Git配置为忽略此错误?:git config --global safe.directory '*'

您应该让自己成为文件夹的所有者。

最新更新