Not sure if I totally got your point, if you are talking about the remote side push history in below screenshot.

For local repos, you could take a look at this thread:
Actually, when you execute git reflog expire --expire=now --all and
git gc --prune=now, the danglind commits were removed. You can double
check by git fsck --full. If the output doesn’t show commits, that
means there has no dangling commits.
However you could not perform any git command for remote git repo, this should cause by this as Daniel also mentioned above:
We rolled out commit reachability bitmap indexes to VSTS and removed
the clone cheat mentioned below. Cloning will no longer download
unreachable objects!. We still don't have true object-level git gc on
the server yet, but clone sizes will be smaller now.
TFS on-prem will get these changes in v.Next (not in any TFS 2017
updates, but the next major release).