Ican Ican - 1 year ago 226
Git Question

Error in tree: contains duplicate file entries

Having an issue moving an existing repo to another origin where it's claiming a tree has duplicate file entries.

git fsck --full
Checking object directories: 100% (256/256), done.
error in tree 4ef325894daeb3a7eeaba4cb7b40b43844f2974c: duplicateEntries: contains duplicate file entries
Checking objects: 100% (25808/25808), done.


When I run
git show 4ef325894daeb3a7eeaba4cb7b40b43844f2974c
on the hash for the tree it's showing two directories.

Controllers/
Controllers/


I've tried making a new tree to replace the broken one but the issue still persists, it could be that I'm doing it on the wrong tree but I'm not sure as there are two trees.

git ls-tree 4ef325894daeb3a7eeaba4cb7b40b43844f2974c
040000 tree fc9af05207cd34539b6b0fe81ce7a3f1370d4750 Controllers
040000 tree fc9af05207cd34539b6b0fe81ce7a3f1370d4750 Controllers


Example of trees

Answer Source

From my experience you need to create a new tree to replace the broken one.

Either that or if the history of the repo is not as important. You can delete .git folder and it should allow you to push without issue.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download