1

error

I have no idea why this problem is happening when I try to clone a GitHub fork. This problem happens with other forks as well.

zucc0nit
  • 346
  • 3
  • 14
  • Here is another post that answers your question. https://stackoverflow.com/questions/7860751/git-fatal-unable-to-create-path-my-project-git-index-lock-file-exists – Matt Binz Aug 31 '18 at 04:25

1 Answers1

0

Try and create one manually.

If you can't (create it manually), that could highlight a permission issue, which would explain why it was not created by Git in the first place.

As the OP zuckonit mention in the comment:

I fixed it: If I disable ransomware protection on my PC, everything is fixed.

https://i.imgur.com/TEQ6T91.png

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I'm starting to think this is an issue with GitHub desktop. Even when I change branch, I get a big error. ([here is a snip of the error](https://i.imgur.com/laCGKHu.png)) – zucc0nit Aug 31 '18 at 06:48
  • @zuckonit check there is no other process running on those files: as a test, try changing branch just after having rebooted (to minimize the processes). Check also the embeded Git version: only Git 2.19 will mitigate that: https://stackoverflow.com/a/51755262/6309 – VonC Aug 31 '18 at 06:51
  • How would I check what processes are running on those files? I ran `git gc --auto` and it did nothing to resolve the issue. – zucc0nit Aug 31 '18 at 07:00
  • @zuckonit https://stackoverflow.com/a/34702821/6309 or https://stackoverflow.com/a/31918643/6309: search for "gh00": that will give you all processes with an open handle on those files. – VonC Aug 31 '18 at 07:11
  • Process explorer found nothing. – zucc0nit Aug 31 '18 at 07:25
  • I will also like to point out that the [index.lock file is missing.](https://i.imgur.com/RGbAKWv.png) – zucc0nit Aug 31 '18 at 07:26
  • @zuckonit in that case, Git itself must have locked those files because of a git gc (as explained in https://stackoverflow.com/a/51755262/6309). Git 2.19 will teach git gc to release properly those files. – VonC Aug 31 '18 at 07:26
  • Can you try, still using GitHub Desktop, to type first `git config --global gc.auto 0` (in any folder you want) (see in https://stackoverflow.com/a/28092576/6309). Then check if the issue persists. – VonC Aug 31 '18 at 07:27
  • No matter what I do with github desktop [I still get errors.](https://i.imgur.com/79nFmTR.png) I deleted a repo and then cloned it from github and I get a new error. – zucc0nit Aug 31 '18 at 07:32
  • @zuckonit Did you type the `git config --global gc.auto 0` first? – VonC Aug 31 '18 at 07:46
  • @zuckonit For testing, can you try and run GitHub Desktop as admin? – VonC Aug 31 '18 at 07:48
  • I fixed it. [If I disable ransomware protection on my PC, everything is fixed.](https://i.imgur.com/TEQ6T91.png) – zucc0nit Aug 31 '18 at 20:44
  • @zuckonit Great, well done! I have included your comment and picture in the answer for more visibility. – VonC Aug 31 '18 at 20:46