This can happen if you do git push --force
to send conflicting commits to the server. This can work if the writer of the other conflicting commit then immediately pulls the forced commit and merges it -- he still has his own commit attached and the pull will show the conflict on his side (no one else will notice except when doing fsck -- SOMEONE HAS TO DO the merge. Just pushing it into oblivion is not a solution and abviously git's default settings are not for the average developer! Then the conflicting commit will be pushed aside and dangle around without being attached to the tip or how you call it. You can check that by running git fsck:
$ git fsck
Checking object directories: 100% (256/256), done.
dangling commit 4f851a97274917a1486f81833c6e96c4b1efeabc
You can also prevent your developers from using force
. Solution: add the following to your repositories config file:
[receive]
denyNonFastForwards = true
See also http://randyfay.com/content/avoiding-git-disasters-gory-story