美文网首页
2023-09-24 windows上TortoiseGit 报

2023-09-24 windows上TortoiseGit 报

作者: 赵海洋 | 来源:发表于2023-09-23 22:50 被阅读0次

在一次换了电脑(硬盘clone)之后,我的TortoiseGit在操作git代码时就会有以下提示,使用SystemInformer查看电脑上的账户对应的sid发现。git提示的文件夹现有拥有者是Administrators组,而当前用户是当前正在登录的这个用户。

image.png

网上的方案有两种:
1、按着提示,将代码目录添加到git的安全目录列表中,这样git就不会检测这个目录的所有者了。
2、修改文件夹权限,使用继承权限的方式将所有文件的拥有者改回原拥有者。

但都是很麻烦,需要一个目录一个目录的设置。后来在:Git command returns fatal error: "detected dubious ownership" | Bitbucket Cloud | Atlassian Documentation
中发现以下内容:

if using git > 2.36, there's also a wildcard to add all folders to safe.directory list :

git config --global --add safe.directory '*' # For the current user and all repositories
git config --system --add safe.directory '*' # For all users and all repositories

但实测下来,在windows中是不需要那个单引号的。只需要 git config --global --add safe.directory *即可。

相关文章

网友评论

      本文标题:2023-09-24 windows上TortoiseGit 报

      本文链接:https://www.haomeiwen.com/subject/fphfbdtx.html