When I do a git fsck
, I see a list of dangling objects. Some of these are called dangling commits while others are called dangling blobs. I was wondering as to what the exact difference between these two is.
In git, what is the difference between a dangling commit and a dangling blob?
705 views Asked by vedang At
1
Git creates blob for every file in the repository (unless the same content already exists). Dangling blobs are blobs not associated with any commit and are no much use unless your repository was broken in case of disk failure, etc.
You can see their contents using
git show <blob SHA-1>
.Dangling commits, are the commits, which are not reachable from
HEAD
of any branch. You can still use them, for example by invokinggit cherry-pick <SHA-1>
orgit reset <SHA-1>
.There is more explanation in Scott Chacon's Git user's manual.