【发布时间】:2021-09-03 08:43:05
【问题描述】:
环境:本地 TFS、Git 存储库
在过去的一个月里,我们有一个特定用户的提交从历史中“消失”,以及实际的更改。当我转到代码视图并选择推送选项卡时,我会看到该用户的每个提交(以及 SHA 哈希)。如果我从这个视图查看提交的详细信息,我可以看到它是“由 [user] 推送”和“refs/heads/[branch] udpated from ... to ...”以及差异。这一切似乎都是正常和正确的。
当我转到同一存储库的“提交”选项卡并查看 [分支] 的提交时,从特定日期开始,该用户不存在任何提交。用户的远程分支跟踪似乎是正确的,并且提交肯定会被发送,否则它们不会出现在 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]
有人对可能发生的事情有任何想法或见解吗?我将尽可能添加任何其他详细信息 - 我只是现在不知道什么是相关的。
【问题讨论】:
-
gc 在中间?
-
gc getting in the middle?仅适用于一位用户? -
不同的用户(不同的本地仓库)可能有不同的 gc 配置。也许该用户的 gc 配置过于激进?
-
...configured too aggressively?嗯,好吧。这绝对是我还没有检查过的东西,所以它不会受伤。本地 gc 会影响推送到远程的提交吗? -
不...我猜 remote 本身也可以设置 gc 吗?比如说,我的意思是,你应该看到 gc 配置的仓库就是你运行这些命令的地方。