2

I used to have GoogleDrive on my PC that uploaded all my code on the drive. I was working on the main branch because I got this project on GitHub, so I deleted all the desktop.ini files and tried to pull the project to update the changes made by my co-workers, but got this error.

The problem didn't occur to me at first because GoogleDrive takes a few minutes to make all the desktop.ini, but when it did it caused problems.

> git pull pmo main
remote: Enumerating objects: 85, done.
remote: Counting objects: 100% (77/77), done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 59 (delta 25), reused 59 (delta 25), pack-reused 0
Unpacking objects: 100% (59/59), 6.63 KiB | 218.00 KiB/s, done.
fatal: bad object refs/desktop.ini
error: https://github.com/*******/*******.git did not send all necessary objects

I tried to remove the .git/refs/desktop.ini with the command rm but it says that i do not have access to it, even in the powershell.

Christian
  • 4,902
  • 4
  • 24
  • 42
Pinguiz
  • 51
  • 4

1 Answers1

0

That is why it is preferable to not work in a network-synchronized drive: git pull/push/clone won't work well with the concurrent synchronization that comes with a Google Drive.

It is better to save on that drive a git bundle (which stores your repository in one file), while collaborating with others through the remote GitHub repository (cloned locally in a normal folder)


Ez0r suggests in the comments to use a tool like Everything to search and delete any occurrences of desktop.ini.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Well that would solve the problems if i actually wanted to keep Drive Going, but still i am not able to use the pull. – Pinguiz Dec 11 '22 at 14:43
  • @Pinguiz You mean: "still i am not able to use the pull": outside any Drive folder? – VonC Dec 11 '22 at 14:52
  • yes i decided to uninstall Drive and delete all the desktop.ini files, still that problem persists. – Pinguiz Dec 11 '22 at 15:08
  • 1
    search for desktop.ini in that git, then delete all (a tool like "everything" can help) – Ez0r Jul 19 '23 at 15:10
  • @Ez0r, thank you!!! Used Everything to search for desktop.ini and deleted them all. Solved a very annoying issue I've had for ages. – DanielV Jul 28 '23 at 07:45
  • @Ez0r Thank you indeed. I have included your comment in the answer for more visibility. – VonC Jul 28 '23 at 08:12