为什么出现在 "Pushes" 中的提交没有出现在 "History" 中?

Why are commits that show up in "Pushes" not showing in "History"?

环境:本地 TFS,Git 存储库

在过去的一个月里,我们有一个特定的用户从历史记录中“消失”了提交,以及实际的更改。当我转到代码视图和 select 推送选项卡时,我看到了来自该用户的每个提交(连同 SHA 哈希)。如果我从这个视图查看提交的详细信息,我可以看到它是“由 [user] 推送”和“refs/heads/[branch] 从 ... 更新到 ...”以及差异.这一切看起来都很正常和正确。

当我转到同一存储库的“提交”选项卡并查看 [branch] 的提交时,none 的提交是从特定日期开始来自该用户的。用户的远程分支跟踪似乎是正确的,提交肯定会被发送,否则它们不会显示在 Pushes 视图中。我也找不到使用 Git Bash 和以下任何命令的任何这些提交:

$ git branch --contains [short hash]
error: malformed object name [short hash]

$ git branch --contains [full hash]
error: no such commit [full hash]

$ git log -p [short hash]
fatal: ambiguous argument '[short hash]': unknown revision or path not in the working tree

$ git log -p [full hash]
fatal: bad object [full hash]

$ git show [short hash]
fatal: ambiguous argument '[short hash]': unknown revision or path not in the working tree

$ git show [full hash]
fatal: bad object [full hash]

有人对可能发生的事情有任何想法或见解吗?我会尽我所能添加任何其他详细信息 - 我只是不知道此时的相关内容。

If an interactive rebase was, in fact, done... I'd have no way to tell from my local Git repository, or even the remote repository.
It's still possible, though, that this could've happened and wiped out a month's worth of one developer's commits? (on purpose or not is irrelevant)

不,它不应该消灭任何东西。即使 SHA1 被变基更改,提交也应该(除非被变基压缩或删除)在那里。

据我在 TFS push API 中看到的,推送视图显示推送 事件
但是,例如,如果一个分支(那些提交被推送的地方)被删除(使这些提交可能未被引用),那么您将不再在该分支的可见历史记录中看到它们存储库,您也无法获取它们。

实际上,您可以直接尝试 fetch the last developer's commit SHA1,查看 TFS 远程 Git 存储库是否仍存储(在 reflog 中)上述提交。
如果可行,那么您可以从所述获取的提交创建一个本地分支,然后推回该分支:这将使开发人员的不可见历史再次可见。