1

I've got this problem:

A team member pushed a corrupted file to the repo on azure devops (on premise), we found the corrupted file because navigating the commits on devops, that one was impossible to open or download, also if we try to download the repo as zip the operation was failing.

We have deleted the file from the repo on devops and then pushed another (good) one, after this operation it is possible to download the repo as zip BUT everyone that have the repo before the push containing the corrupted file cannot fetch, pull or clone the repository (probably because the corrupted file still in history ??).

From my local repo, that is before the push, i tryied to remove the file with "git filter-branch" but it seems that the operation found nothing, probably because it works locally (?) So I am in this situation, I can't pull and I can't clone but if i cannot get the lastest version i cannot remove the file too. Someone have any hint to suggest that does not imply a revert before the push? Thank you

Explanation simple: I need to remove a corrupted file from a repository but i can't clone it because of the corrupted file, Is there any method that does not imply a revert before the push that include the corrupted file?

PS: clone fail with this

remote: Azure Repos
remote: Found 35611 objects to send. (559 ms)
error: inflate: data stream error (incorrect header check)iB/s
fatal: pack has bad object at offset 326294050: inflate returned -3
fatal: fetch-pack: invalid index-pack output
Alessandro
  • 11
  • 2
  • Much clearer - is that the same error everyone gets? `everyone that have the repo before the push containing the corrupted file cannot fetch` this is a reference to a different command. In any event searching for info on the errors received should help - e.g. does this provide a path forwards (note in context here `git fsck` needs running _on the server_)? https://stackoverflow.com/questions/23725925/git-repository-corrupt-incorrect-header-check-loose-object-is-corrupt – AD7six Dec 01 '21 at 10:54
  • The error is the same for cloning, fetching or pulling for everyone who has the local repo before the push. Obviously I've serached for hours on SO and others but I've not found anything usefull. The problem is that the commit was already pushed (without error) by the team member and at the moment he is the only one able to push something, everybody else is stucked. git fsck on my local repo does not report anything – Alessandro Dec 01 '21 at 11:08
  • `I've serached for hours on SO and others but I've not found anything usefull` - it took me 20s to find that post (by googling 'inflate: data stream error (incorrect header check)iB/s') have you tried the advice in the answers? What other questions have you found on the topic :)? `git fsck on my local repo does not report anything` please re-read my above comment. – AD7six Dec 01 '21 at 11:09
  • git fsck --full Checking object directories: 100% (256/256), done. Checking objects: 100% (33604/33604), done. BTW the problem is server side, not client side. I cannot work on the local repo who pushed the broken file. – Alessandro Dec 01 '21 at 11:12

1 Answers1

-1

Should do the trick hopefully:

git reset --hard <last good commit>