What are dangling objects, and how do git fsck and the reflog relate to them?
Last updated
Dangling objects exist in the object database but are unreachable from any branch, tag, or
HEAD(e.g. aftergit reset --hardor deleting a branch).git fsckverifies the database and reports them (e.g.dangling commit <sha>, or--lost-found).The reflog records past positions of
HEADand branches, keeping such commits recoverable. Once entries expire (~90 days),git gcprunes them.
- https://medium.com/etticblog/hunting-erased-secrets-in-dangling-commits-9d090210ee1e
- https://dev.to/rijultp/stumbled-on-a-dangling-commit-heres-what-it-really-means-45gl
- https://gist.github.com/ammarshah/a20c5cfc206f1aeb0f6e8db24eb5d17f
- https://git-scm.com/docs/git-fsck
- https://git-scm.com/docs/git-fsck/2.21.0
- https://git-scm.com/book/en/v2/Git-Internals-Maintenance-and-Data-Recovery
- https://webcodingcenter.com/git/reflog-and-recovering-lost-work--finding-dangling-objects-with-fsck.html
- https://git-scm.com/docs/user-manual/2.32.0