No matter what repository I get a broken git working tree. For example, a random repository:
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 :/'
I am on Windows 10 and the latest version of git. git restore --source=HEAD :/
works but I should not have to do that all the time. Furthermore, I've uninstalled and reinstalled git multiple times.
The only thing I think might have impacted it was that this seemed to start around installing VS2019 Community (I set Source Control to none), but that's the only clue I've had.
This is driving me nuts!
Edit: not a duplicate as none of the solutions worked. Also, git init
, git add .
creates no problems. This is only cloning existing repos.