解决 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 .
相关推荐
杨凯凡2 小时前
IT日报|2026-11-19:Oracle Java 紧急补丁、Optimizely 供应链攻击、GitHub 安全评估升级
java·oracle·github
徐小夕2 小时前
深度拆解 Design Agent:LangChain 出品,AI 设计从「好看」走向「可用」
前端·vue.js·github
严肃小白兔3 小时前
GitHub Copilot 团队级 Agent Plugins 正式发布:插件架构、共享配置与实战
github·copilot
狂师4 小时前
太强了!三周冲到8.6k+ Star,免Root 免电脑,Mika 在后台替你操作所有App
github·agent·测试
wflynn16 小时前
GitHub 日榜趋势速报 | 2026-11-18
开源·github
Hvitur17 小时前
Git - 多分支合并
git·github
laoyeye83121 小时前
手写 vLLM 分页 KV Cache(三):引用计数、写时复制(CoW)与前缀缓存
人工智能·github
一条Go1 天前
边缘 Agent:为什么是它连出来,而不是平台连进去
后端·架构·github
一条Go1 天前
开源新生代雷达 · 第 15 期
github
OpenTiny社区1 天前
我用Vue 100%复制DeepSeek开源的网页App,代码更少,功能还更多!
前端·vue.js·github