Questions concerning dangling commits or blobs in Git. These are commits or blobs without references, which can be lost. For pointers to an invalid memory location, use [dangling-pointer] instead.
Questions tagged [git-dangling]
13 questions
166
votes
4 answers
Git: what is a dangling commit/blob and where do they come from?
I'm looking for the basic info on dangling commits & blobs.
My repo seems fine. But I ran git fsck for the first time to see what it did and I have a long list of 'dangling blobs' and a single 'dangling commit'.
What are these things? Where did…
![](../../users/profiles/263900.webp)
doub1ejack
- 9,047
- 15
- 60
- 110
161
votes
7 answers
Listing and deleting Git commits that are under no branch (dangling?)
I've got a Git repository with plenty of commits that are under no particular branch, I can git show them, but when I try to list branches that contain them, it reports back nothing.
I thought this is the dangling commits/tree issue (as a result of…
![](../../users/profiles/171428.webp)
Samer Buna
- 7,413
- 8
- 36
- 53
65
votes
3 answers
git: dangling blobs
I recently ran git fsck --lost-found on my repository.
I expected to see a couple dangling commits, where I had reset HEAD.
However, I was surprised to see likely over several thousand dangling blob messages.
I don't believe anything is wrong with…
![](../../users/profiles/136451.webp)
wadesworld
- 12,653
- 12
- 55
- 90
28
votes
2 answers
How to remove a dangling commit from GitHub?
Yesterday, I pushed to my fork of ConnectBot on GitHub. I pushed once, realized that I hadn't made the change the way I wanted, redid the commit and pushed again.
Now, GitHub has both commits:
https://github.com/nylen/connectbot/commit/1cd775d –…
![](../../users/profiles/106302.webp)
We Are All Monica
- 11,597
- 7
- 41
- 69
9
votes
1 answer
Search for string in dangling commits in Git
The following monstrosity very nicely found a git stash containing the word Upload which is what I was looking for:
git fsck --no-reflog | awk '/dangling commit/ {print $3}' | \
while read ref; do if [ "`git show -p $ref|grep -c Upload`" -ne 0 ];…
![](../../users/profiles/308851.webp)
chx
- 10,450
- 5
- 44
- 108
8
votes
2 answers
git: Are these dangling commits?
Given at the end is an extracted screenshot from a SourceTree branch tree view (there is a gap in the middle of the screenshot)
In that, #1 points to the line which used to be branch 1.7.6.14.X and #2 points to the current status of the same…
![](../../users/profiles/813976.webp)
Upendra
- 823
- 1
- 8
- 21
3
votes
1 answer
git fsck combining --lost-found and --unreachable
I found many interesting posts about git fsck, so I wanted to experiment a little on them. First of all the sources I read before this question:
How can I find an unreachable commit hash in a GIT repository by keywords?
git fsck: how --dangling…
![](../../users/profiles/5587393.webp)
Marco Luzzara
- 3,078
- 3
- 9
- 28
3
votes
1 answer
In git, what is the difference between a dangling commit and a dangling blob?
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.
![](../../users/profiles/137430.webp)
vedang
- 2,971
- 2
- 19
- 33
1
vote
3 answers
How to git-commit from a branch to a detached HEAD?
My ref HEAD points the branch foo, that points to the commit 123abc; and I have some staged work.
How to git commit that work, moving the HEAD to the newly created commit, but without advancing the branch?
(hence: leaving foo point to 123abc)
Is it…
![](../../users/profiles/3088045.webp)
Kamafeather
- 5,651
- 10
- 44
- 74
1
vote
1 answer
Git can't find dangling tree origin
I was running a difference checker between my current files and a backup of the files on my external drive, and I found some differences between a git repo and it's backup. The only differences were some extra files under .git/objects on the left…
![](../../users/profiles/1852456.webp)
woojoo666
- 7,103
- 6
- 38
- 51
1
vote
1 answer
How to match dangling blobs with file names in Git?
I have yet another example of doing a git rm -rf without an initial commit. (I realized I had added lots of useless files and wanted to add some filters.)
Now I am left with 23000 dangling blobs with no tree, but with a complete Git history!
I'll…
![](../../users/profiles/1639700.webp)
PaulDj
- 31
- 3
0
votes
1 answer
Pruning dangling commits from GitHub fork
I forked a repo on GitHub.
I pushed commits (whose commit messages contain references to issues in the original repo) to my fork.
I pushed the same commits multiple times while rebasing, rewording, etc.
Thus, I've pushed different versions of the…
![](../../users/profiles/2030088.webp)
XDR
- 3,457
- 3
- 23
- 42
0
votes
2 answers
Do dangling git add blobs get pushed to master repository?
We can recover files, which were once added (but not committed) and later removed using git reset --hard.
See Recovering added file after doing git reset --hard HEAD^
When we push in our changes to some upstream repository, Are these blobs also…
![](../../users/profiles/1860929.webp)
Anshul Goyal
- 61,070
- 31
- 133
- 163