解决 fatal: detected dubious ownership in repository at ‘XXXX‘ 问题

重装系统后,重新下载git之后,出现了这个问题:

复制代码
fatal: detected dubious ownership in repository at 'V:/Web/Github_commit/Interview'

这个错误表明 Git 检测到仓库的所有者和当前用户不一致,这可能被视为一个安全风险。要解决这个问题,可以将该目录标记为"安全目录"

解决步骤

复制代码
// step 1
git config --global --add safe.directory 'V:/Web/Github_commit/Interview'

// step 2
git config --global --get-all safe.directory

// step 3
git add .
相关推荐
shandianchengzi14 小时前
【记录】Copilot|Github Copilot重新学生认证通过方法(2025年7月,包括2FA和认证材料、Why are you not on campus)
github·copilot
K1ne_14 小时前
2026 最新版|学生认证白嫖 GitHub Copilot Pro 保姆级教程
github·copilot
cs.shunzhang15 小时前
GitHub 教育认证通过后如何领取 Copilot Pro
github·copilot
程序员柒叔15 小时前
OpenCode 踩坑记:GitHub Copilot 按次计费?我的账单为何暴涨 3 倍!
github·copilot·claude code·opencode
刚刚觉醒的小菜鸡15 小时前
copilot学生认证2026-github copilot学生认证(手把手教会)
github·copilot
徐小夕15 小时前
我花一天时间Vibe Coding的开源AI工具,一键检测你的电脑能跑哪些AI大模型
前端·javascript·github
一乐小哥1 天前
如何写一个好的 Pull Request
github
Hommy881 天前
【开源剪映小助手】云渲染环境搭建
python·开源·github·剪映小助手
Robot_Nav1 天前
Git 项目维护命令指南相关讲解
git·机器人·github
逛逛GitHub1 天前
给你的 Claude Code 装上一个超酷的状态栏。 逛逛GitHub
github