git: Are these dangling commits?
<p>Given at the end is an extracted screenshot from a SourceTree branch tree view (there is a gap in the middle of the screenshot)</p>

<p>In that, <code>#1</code> points to the line which used to be branch <code>1.7.6.14.X</code> and <code>#2</code> points to the current status of the same branch.</p>

<p>The commit referred to by <code>#3</code> and the preceding 8 commits on that line were previously attached to branch <code>1.7.6.14.X</code>. Then another developer supposedly checked out the same branch and did the fix pointed to by <code>#4</code>. This <code>#4</code> commit has removed the former 9 commits from branch <code>1.7.6.14.X</code> and left them dangling. <br>As a result, the branch <code>1.7.6.14.X</code> now starts from the original branching point instead of just extending from commit <code>#3</code>.</p>

<p>Running <code>git fsck</code> with <code>--unreachable</code>, <code>--dangling</code> etc doesn't give any errors. I tried <code>--lost-found</code> as well.</p>

<p>However, <code>git fsck &lt;hash of commit #3&gt;</code> produces five dangling commits and a whole bunch of dangling tags:</p>

<pre><code>Checking object directories: 100% (256/256), done.
Checking objects: 100% (3148/3148), done.
dangling commit ec213...
dangling commit ab82a...
dangling commit 7d262...
dangling commit a6f06...
dangling commit 6674a...
</code></pre>

<p>I have two questions:</p>

<ol>
<li><p>What could have caused this situation (i.e. branch <code>#1</code> getting detached)?</p></li>
<li><p>How can I detect whether there are similar issues in other repositories? (<strong>without</strong> having to know the hashes of detached commits such as <code>#3</code>)</p></li>
</ol>

<p><a href="https://i.stack.imgur.com/wzs1G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wzs1G.png" alt="Commits detached from branch"></a></p>

<p><strong>Update</strong>:</p>

<p>We found the answer to question (1). The situation was caused by a force push, to the central bare repo, by a developer who had an older snapshot of the branch.</p>