git - 无论存储库如何,Git 总是使用损坏的工作树进行克隆
问题描述
无论是哪个存储库,我都会得到一个损坏的 git 工作树。例如,一个随机存储库:
PS D:\> git clone https://github.com/dylanaraps/pure-bash-bible.git
Cloning into 'pure-bash-bible'...
remote: Enumerating objects: 113, done.
remote: Counting objects: 100% (113/113), done.
remote: Compressing objects: 100% (71/71), done.
Receiving objects: 100% (882/882), 242.02 KiB | 3.56 MiB/s, done.
Resolving deltas: 100% (502/502), done.
fatal: this operation must be run in a work tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
我在 Windows 10 和最新版本的 git 上。git restore --source=HEAD :/
工作,但我不应该一直这样做。此外,我已经多次卸载并重新安装了 git。
我认为可能影响它的唯一一件事是这似乎是从安装 VS2019 社区开始的(我将源代码控制设置为无),但这是我所拥有的唯一线索。
这让我发疯!
编辑:不是重复的,因为没有一个解决方案有效。此外,git init
,git add .
不会产生任何问题。这只是克隆现有的存储库。
解决方案
推荐阅读
- r - 在 RStudio 中加载 Tidyverse 的问题
- api - 为不同的管道(:api和:browser)呈现不同的错误?
- vue.js - Vue Props 值未在简单测试中通过
- c - 为什么最后一个索引的节点在使用 igraph 生成的随机网络中没有过度代表?
- rest - 如何形成nexus 3的搜索网址
- javascript - 在 Chart.js 中使用数组作为数据
- r - 单列的 3D 带状图
- c# - SerialPort.Write() 方法挂起
- ios - Swift UIView 约束恒定高度更改时间获取 LayoutConstraints 警告
- javascript - 如果在gridview的其他列中按升序进行排序,如何使序列号自动生成稳定和固定