Handling bad sha1 files

I get these errors when running git fsck --full --no-dangling in a remote repository. (GIT server)

 user@server :/var/git/REPOSITORY.git$ git fsck --full --no-dangling bad sha1 file: ./objects/15/19d8eeacc8d0cd603bd87d2034508b1ffaffa8_28537991145d7e9d87b68335e9b82c2f788cb4fc bad sha1 file: ./objects/32/4f425bcfe23d9f38b154427eeb9c800d109365_6df2d745fff22839759b25cc83f8d742c2e64086 bad sha1 file: ./objects/42/9225fd8d895084051189dc6478343d54fe41c8_28537991145d7e9d87b68335e9b82c2f788cb4fc bad sha1 file: ./objects/46/798e4a01a5a7eaf2b203f6d1634d603497041b_6df2d745fff22839759b25cc83f8d742c2e64086 bad sha1 file: ./objects/bc/fb9d62ac05d5203249caa0e7e9cb5d1c32daba_6df2d745fff22839759b25cc83f8d742c2e64086 bad sha1 file: ./objects/cd/477947092b4f20feba8c37df974027b1864215_6df2d745fff22839759b25cc83f8d742c2e64086 Checking object directories: 100% (256/256), done. Checking objects: 100% (136737/136737), done. missing commit 590ebc3ac022491d7f11c483480fa9530adc91e8 missing tree bab1d768f0d4f6a02e0a30a6c446afaeabc4aa71 

For each bad sha1 file, there is another file that starts with the same name but does not have an underscore _ , and then another text. files have the same file size, but different date and time.

An example of two files:

 ./objects/15/19d8eeacc8d0cd603bd87d2034508b1ffaffa8_28537991145d7e9d87b68335e9b82c2f788cb4fc ./objects/15/19d8eeacc8d0cd603bd87d2034508b1ffaffa8 

I attach screenshots from two cases out of 6, because they are all the same:

Screenshot 1: File1

Screenshot 2: File 2 Can I remove duplicates, what will happen?

* any ideas on the missing commit \ tree?

+7
git sha1 corruption
source share
1 answer

Firstly, since the problem is on the server, check if you have any clone that will not show the same problem: you can make a local annual repo clown from this clone and replace your " user@server :/var/git/REPOSITORY.git ", with a copy of the specified bare repo.

Secondly, on the server:
Just make a copy of user@server :/var/git/REPOSITORY.git in user@server :/var/git/REPOSITORY2.git , delete these files _ and see if the error persists.
I assume the missing team and tree will still be there. This means that you need to look for those in the clone to restore them, as I recommend in How to diagnose and fix git fatal: it is impossible to read the tree . "
See More in How to fix a damaged git repository? .

+2
source share

All Articles