为什么 git diff 输出对于 2 个哈希与 1 个不同?

Why is git diff output different for 2 hashes vs 1?

我想弄清楚为什么 git diff [branch_name] [hash] 的输出不同于 git diff [hash] 而站在 [[=14] =]]? (请注意带有 [hash] 的 diff 的 SHARED 文件夹和带有 [branch_name] 和 [hash] 的 diff 的 DWH4DMS 文件夹) 例子如下:

U_M14V5@A120621 MINGW64 /d/tst/packer/local_repo (DWH4DM-9676)
$ git status
On branch DWH4DM-9676
nothing to commit, working tree clean

U_M14V5@A120621 MINGW64 /d/tst/packer/local_repo (DWH4DM-9676)
$ git diff --name-only fb6066b88ecd4
ETL/Informatica/REP_DW_PROD/DWH4DMS/mappings/m_IFRSBALANCE_SSTAT__CBBALANCE_DMDELTA.xml
ETL/Informatica/REP_DW_PROD/DWH4DMS/mapplets/mpl_CBTERDEP_UK_rg.xml
ETL/Informatica/REP_DW_PROD/DWH4DMS/sessions/s_m_IFRSBALANCE_SSTAT__CBBALANCE_DMDELTA.xml
ETL/Informatica/REP_DW_PROD/SHARED/mapplets/mpl_CBTERDEP_UK.xml

U_M14V5@A120621 MINGW64 /d/tst/packer/local_repo (DWH4DM-9676)
$ git diff --name-only DWH4DM-9676 fb6066b88ecd4
ETL/Informatica/REP_DW_PROD/DWH4DMS/mappings/m_IFRSBALANCE_SSTAT__CBBALANCE_DMDELTA.xml
ETL/Informatica/REP_DW_PROD/DWH4DMS/mapplets/mpl_CBTERDEP_UK.xml
ETL/Informatica/REP_DW_PROD/DWH4DMS/mapplets/mpl_CBTERDEP_UK_rg.xml
ETL/Informatica/REP_DW_PROD/DWH4DMS/sessions/s_m_IFRSBALANCE_SSTAT__CBBALANCE_DMDELTA.xml

因为当您使用单个修订版时,您不是在与 HEAD 进行比较,而是在与工作树上的内容进行比较。

第二种理论: 有一个重命名的文件,因此它显示了 2 个不同修订版的文件路径。