我换了一台电脑,将旧电脑的硬盘换到新电脑上;我装了双系统,切换到另一个系统时;我发现了 git 代码仓库无法执行 git 命令,不断报错 fatal: detected dubious ownership in repository at 'C:\lindexi\Code\Foo' is owned by: 'S-1-5-21-469934170-xxx-xxx-1001' but the current user is: 'S-1-5-21-469994170-aaa-bbb-1001' 失败。本文记录此问题的解决方法

解决方法:

1.如 git 的命令行提示,输入 git config --global --add safe.directory 'git提示的那个文件夹路径' 命令

输入完成之后,先试试 git branch 命令,如果依然不可用,报错和之前一样,那就需要接下来的一步

2.更改文件夹的所有者。更改方法如下

  • 右击文件夹,点击属性
  • 进入安全选项卡,点击高级
  • 进入高级,修改所有者为当前登录账号

更改所有者之后,再次试试 git 命令,预计此时就可以使用

git fatal detected dubious ownership in repository 的解决方法的更多相关文章

  1. git 本地电脑重新装git后 更新github项目报错 fatal: detected dubious ownership in repository at

    解决方法参考: fatal: detected dubious ownership in repository at 'D:/'之解决方法 1.今天在学习git的时候出现这个错误: 2.执行下面代码即 ...

  2. git pull“No remote repository specified”解决方法

    git pull“No remote repository specified”解决方法 学习了:http://www.paopaoche.net/jiaocheng/77226.html 修改“.g ...

  3. 〖Linux〗git push orgin master不能解析域名的解决方法

    错误信息: $ git push origin master ssh: Could not resolve hostname bitbucket.org: Name or service not kn ...

  4. linux centos7 “git clone https://github.com/XXXXX” 报错解决方法

    2021-08-04 1. 问题描述 在执行以下命令时出现错误"正克隆到 'XXXXX'... fatal: unable to access 'https://github.com/lag ...

  5. git fatal: remote origin already exists. 报错解决

    在研究git的时候,随便输了个 git remote add origin xxx; 然后再真正add 远程仓库的时候,报了git fatal: remote origin already exist ...

  6. Git 2.x 中git push时遇到 push.default 警告的解决方法

    近在学习使用 git&GitHub,然后今天遇到了一个问题.在执行 git add 和 git commit 操作之后,再进行 git push 操作,出现了如下提示: $ git push ...

  7. git 本地与远程仓库出现代码冲突解决方法

    提交过程中报错: [python@heaven-00 Selesystem]$ git push -u origin masterUsername for 'https://github.com': ...

  8. Eclipse的Git插件Egit: merge合并冲突具体解决方法

    http://www.cnblogs.com/wavky/p/3504060.html 稍微总结下弄了半个下午的egit的merge合并冲突解决方法,网上看的都是一个模板出来的,看的糊里糊涂,花了很多 ...

  9. jenkins在windows服务器上执行含git push命令的脚本权限不足的解决方法

    错误摘要 默认情况下执行脚本是没问题的,但是脚本中含有git push命令就无法执行了 用jenkins部署hexo博客时候遇到的,执行hexo d -g一直阻塞至Build was aborted, ...

  10. FATAL ERROR: Could not find ./bin/my_print_defaults 解决方法

    FATAL ERROR: Could not find ./bin/my_print_defaults If you compiled from source, you need to run 'ma ...

随机推荐

  1. 基于PyQGIS实现遥感影像下载

    1. 引言 之前的文章:QGIS中下载遥感影像的Python代码片段 - 当时明月在曾照彩云归 - 博客园 (cnblogs.com),记述了在 QGIS 的 Python Console 中使用Py ...

  2. 开发必会系列:《深入理解JVM(第二版)》读书笔记

    一  开始前 HotSpot:http://xiaomogui.iteye.com/blog/857821 http://blog.csdn.net/u011521890/article/detail ...

  3. AABO:自适应Anchor设置优化,性能榨取的最后一步 | ECCV 2020 Spotlight

    论文提出超参数优化方法AABO,该方法核心基于贝叶斯优化和Sub-Sample方法,能够自适应的搜索最优的anchor设置.从实验结果来看,AABO能够仅通过anchor设置优化,为SOTA目标检测方 ...

  4. archlinux 时移(timeshift)不会自动创建快照

    这是因为没有开启定时任务服务 解决办法 1.安装定时任务服务 sudo pacman -S cronie 2.设置自启动 sudo systemctl enble cronie

  5. archlinux xfce 设置fcitx5中文输入法详细教程

    1.安装fcitx5 sudo pacman -S fcitx5-im fcitx5-chinese-addons fcitx5-pinyin-zhwiki fcitx5-im 包含fcitx5的一些 ...

  6. BeautifulSoup 库 和 re 库 解析腾讯视频电影

    1 import requests 2 import json 3 from bs4 import BeautifulSoup #网页解析获取数据 4 import sys 5 import re 6 ...

  7. #zkw线段树#洛谷 3792 由乃与大母神原型和偶像崇拜

    题目 给你一个长为 \(n\) 的序列 \(a\) 每次两个操作: 修改 \(x\) 位置的值为 \(y\) 查询区间 \([l,r]\) 是否可以重排为值域上连续的一段 分析 直接维护区间最大值和最 ...

  8. 使用OHOS SDK构建benchmark

    参照OHOS IDE和SDK的安装方法配置好开发环境. 从github下载源码. 执行如下命令: git clone --depth=1 https://github.com/google/bench ...

  9. 本周四晚19:00知识赋能第3期直播丨OpenHarmony智能家居项目之控制面板功能实现

    OpenAtom OpenHarmony(以下简称"OpenHarmony")开源开发者成长计划项目自 2021 年 10 月 24 日上线以来,在开发者中引发高度关注. 成长计划 ...

  10. MogDB/openGauss访问控制简介

    MogDB/openGauss 访问控制简介 SQL 可以针对不同的数据库对象赋予不同的权限,这样就可以限制用户对数据的不必要访问,提高数据访问的安全性.常见的 SQL 权限如下: SELECT/UP ...