0

I've been running Android Studio on Windows, with git doing the versioning, and git pushing using git bash for Windows. I've been doing the same thing for all that time, without issue.

Then today, in the event log in Android Studio after opening I see:

17:29   VcsException
            error: Could not read 5188c7b8677be145b04f079e6f9cab08e5c19240
            fatal: Failed to traverse parents of commit 50da9e67a67598125b860984db9e493bd5d1f2ee
            during executing git -c core.quotepath=false log HEAD --branches --remotes --max-count=2000 --pretty=format:%x01%H%x02%ct%x02%an%x02%at%x02%ae%x02%cn%x02%ce%x02%P%x02%s%x02%b%x02%B%x02%d%x03 --encoding=UTF-8 --decorate=full --

And when I try a git operation in the git bash console (Windows) I get:

$ git commit -m 'new stuff'
fatal: unable to read tree 4dfc5598677be145b04f079e6f9cab0833555566

The following is an extract from running git fsck... there is a long list which annoyingly in git bash is not scrollable or selectable:

$ git fsck
dangling blob 7be145b04f079e6f9cab0835664dfc5598673555
missing blob e6f9cab0835664dfc559e145b04f07986735557b
missing tree b04f07986735557be6f9cab0835664dfc559e145
... (lots of dangling blob, a few missing blob, one missing tree) ...

What can I do to fix this?

drmrbrewer
  • 11,491
  • 21
  • 85
  • 181

1 Answers1

0

So, since I've been pushing regularly to the remote repo so I know that is pretty up to date, I followed the low-tech suggestion set out here, combined with the first comment to that suggestion.

So:

  1. create a temporary folder in whatever location you want
  2. clone the repo into that folder with git clone git@bitbucket.org:myaccount/myproject.git
  3. move the .git folder in the existing project folder out into another temporary folder somewhere
  4. move the .git folder from the repo cloned in step 2 into the project folder, to replace the old one moved out in step 3
  5. and that was it... a git add / commit / push we seem to be back on track
drmrbrewer
  • 11,491
  • 21
  • 85
  • 181