Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

git fsck fails with the same error for 3 different repositories

meirof March 8, 2020

I'm running git fsck command on some repositories, and for 3 of them I got the same error:

error in tree b2b510c83ea553c587ebe5bc160e92cb7888393a: duplicateEntries: contains duplicate file entries
error in tree b3969ac6fe6b6359d48006e6a4cf3ffd5a4350a3: duplicateEntries: contains duplicate file entries
error in tree 5a7445940626358083a782ba5c81f956c7f82ac5: duplicateEntries: contains duplicate file entries

any idea how to fix it? what does it mean that it appears exactly the same for all?

1 answer

0 votes
Barry Allen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 8, 2020

Hi There,

I guess you or one of your teammates/colleagues are using Windows OS. Windows OS's file system is case sensitive, so you can have filename.txt and Filename.txt in same place.

That's why you are getting this error, when you run git fsck. One or more files in your repositories have this kind of file name. Please check and find those files then rename/remove it based.

 

If your are window users, please run this command to find those files. I am not using windows, so I didn't tested this command. But I am sure this wouldn't delete/harm your files.

git ls-tree -r HEAD | group { $_ -replace '.{12}(.{40}).*', '$1' } | ? { $_.Count -gt 1 } | select -expand Group

 

Please let me know, if this answer helps you.

meirof March 9, 2020

It's not Windows OS but Linux Redhat. when running git ls-tree I can see the duplication:

040000 tree bedd93cf41a5d3ed9b19a2062cd7f49e930d4227 resources
040000 tree bedd93cf41a5d3ed9b19a2062cd7f49e930d4227 resources

Barry Allen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2020

please checkout and merge those folder, then try again.

meirof March 9, 2020

how do I merge them?

Barry Allen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2020

Are you sure those two "resources" folders are in same directory?

>>> how do I merge them?
If both resources are in same directory, 

  • Rename any one of that "resources" folder as resources_old
  • Compare resources and resources_old folder and move all the new files from resources_old to resources.
  • Then compare the files which are in both resources and resources_old and do the necessary changes in respective files which is in resources folder.
  • Remove resources_old folder

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events