我在运行以下 git 命令时遇到了问题:
Diff between two branches for one file delivers clear information about existing differences:
$ git diff --shortstat develop-2.2 feature/develop-2.2-Grouping -- coba.zaa.tools/coba.zaa.tools.resources/src/main/resources/workflows/processflow/statemachine.ftl 1 file changed, 162 insertions(+), 24 deletions(-)
However a search for the commits with the differences delivers no results:
$ git log --oneline develop-2.2...feature/develop-2.2-Grouping coba.zaa.tools/coba.zaa.tools.resources/src/main/resources/workflows/processflow/statemachine.ftl
这是正确的推理吗?如果是,那么我的代码库是否有损坏?是否有办法检查库的一致性(例如,如果所有提交相同,则所有文件应该是相同的)?
git log
命令中的...
是有意为之的吗?我认为这可能是你遇到问题的原因。 - TriskalJM--full-history
进行操作,如果没有结果,请再次使用--graph --decorate
并发布结果?我认为您也应该看到结果。 - jthillgit fsck
。话虽如此,你对...
的理解是错误的(它是对称差异,而不是后者排除了从前者可达的那些),但即便如此,我也希望..
会产生相同的结果。尽管如此,这种行为似乎并不表明 Git 文件损坏;我建议在使用git log
时使用..
(也许可以省略点号,因为它们在这里无关紧要)和--
,因为除非你有特定的原因怀疑数据损坏,否则更可能是你在使用 Git 方面出了问题(也许是某个地方打错了字)。 - Pockets