I have encountered this situation several times
GIT error:
fatal:multiple stage entries for merged file
You can easily find the corresponding solution by searching online. The solution is as follows:
rm .git/index
git add -A
git commit -m 'fix git fatal error'
But why does this error occur and how to avoid it. I hope friends who know the reason can help me answer my doubts.