0

First off, I am not using command line git at all. I am only using SourceTree's gui interface. I would prefer to solve my problem this way; if possible.

Somehow, my submodule has become corrupted. Attempting to fetch or pull gives me the following error: enter image description here

I haven't found any answers for this particular problem. I am fortunate in that my remote master is ok, 100% up to date, and I have no local changes. So, I think the easiest way will be to just fully reset my local submodule.

However, I can't figure out how to do so.

I considered trying to remove my submodule and then re add it. However, I have had problems with that in the past, and so am gun shy.

I found handfuls of posts about resetting to a specific commit. However, the SourceTree gui is failing to populate my history because of this error.

Any help would be appreciated

Thank you

FunnerSoft
  • 77
  • 7

2 Answers2

0

You can try this

  • Right click at your conflicted branch at BRANCHES and delete it.
  • Double click at your remote branch at REMOTES to re-download and switch to that branch.

Easy, good luck.

BlackLotus
  • 136
  • 2
  • 9
  • thank you for the suggestion. Unfortunately, I get an error when trying to delete master. It looks the same as the error I posted in my original question "fatal: failed to read object 666168c0bacade2e719e0054c11d6903719f13f5: Invalid argument" – FunnerSoft Dec 03 '21 at 16:50
  • I was able to delete it by using the "Force Delete" option. However, trying to re-add master causes the same error message to display. That seems to imply that something is wrong with my remote branch, but I am quite certain that is not the case. I can pull this remote branch in multiple other projects' submodules just fine. I think the issue is that I still have 1 corrupted, local branch within this problem submodule. I can't delete that because Sourcetree says you can't delete your current branch. So, that route seems sort of stuck. – FunnerSoft Dec 03 '21 at 17:00
  • I was able to delete all local branches from my submodule. However, attempting to re-add the master branch to this submodule continues to fail with the above error. I can still pull and update this same master branch in other, different submodules with no issue. – FunnerSoft Dec 03 '21 at 17:39
  • Did you try to delete entire folder and then clone it again? – BlackLotus Dec 04 '21 at 04:02
  • Hi BlackLotus. I did finally get this working. See my answer if you are curious. I just wanted to say thank you for your assistance with this issue. Cheers – FunnerSoft Dec 06 '21 at 17:40
0

I finally did get this fixed. I had to give up and use the command line.

I found this page (git fatal: failed to read object xxx: Invalid argument). That pointed me to using the "git fsck --full" command.

That pointed me to a very specific folder in the .git hierarchy that was corrupted.

I needed to delete this folder, but doing so wasn't easy. Windows would let me delete it. Not in safe mode. Not with cmd del or rmdir. I had to run a scan disk from windows on my entire drive. That ended up detecting the folder and removing it.

Finally, from there, I was able to fetch and pull master again.

FunnerSoft
  • 77
  • 7