Git历史记录既被重写又保持不变?

时间:2019-05-31 06:51:55

标签: git

所以我让Git整夜重写所有分支中的历史记录,当我寻找结果时,我看到了: enter image description here

      E:\zeus>git filter-branch -f --tree-filter "rm -rf ZeusSRC_Hardware_RPi_image_Raspberry Pi_außen_20.05.2019.zip" --prune-empty -- --all
      Rewrite fa2be75c64ca78a296c8f78fc363beebecbf92a1 (1526/1526) (2745 seconds passed, remaining 0 predicted)
      Ref 'refs/heads/Kunden' was rewritten
      Ref 'refs/heads/Sensor' was rewritten
      Ref 'refs/heads/Wetter' was rewritten
      Ref 'refs/heads/ZEUS-5' was rewritten
      Ref 'refs/heads/Zeus_Bug-13' was rewritten
      WARNING: Ref 'refs/heads/master' is unchanged
      Ref 'refs/remotes/origin/ADW' was rewritten
      WARNING: Ref 'refs/remotes/origin/master' is unchanged
      Ref 'refs/remotes/origin/Kunden' was rewritten
      Ref 'refs/remotes/origin/Metzger' was rewritten
      WARNING: Ref 'refs/remotes/origin/Mond' is unchanged
      Ref 'refs/remotes/origin/Sensor' was rewritten
      WARNING: Ref 'refs/remotes/origin/Sonne' is unchanged
      Ref 'refs/remotes/origin/Wetter' was rewritten
      WARNING: Ref 'refs/remotes/origin/ZEUS-2' is unchanged
      WARNING: Ref 'refs/remotes/origin/ZEUS-3' is unchanged
      Ref 'refs/remotes/origin/ZEUS-5' was rewritten
      Ref 'refs/remotes/origin/ZEUS_BUG-12' was rewritten
      WARNING: Ref 'refs/remotes/origin/ZEUS_BUG-4' is unchanged
      Ref 'refs/remotes/origin/ZEUS_BUG-6' was rewritten
      WARNING: Ref 'refs/remotes/origin/ZEUS_BUG-8' is unchanged
      Ref 'refs/remotes/origin/ZEUS_BUG-9' was rewritten
      Ref 'refs/remotes/origin/Zeus_Bug-13' was rewritten
      WARNING: Ref 'refs/remotes/origin/master' is unchanged
      WARNING: Ref 'refs/remotes/origin/metzger' is unchanged
      WARNING: Ref 'refs/remotes/origin/tempAddFirstCode' is unchanged
      Ref 'refs/stash' was rewritten

所以从根本上说,git向我展示了它既改变了又没有改变,是什么原因?

到目前为止,正如我所看到的,本地部分已完全更改,而遥控器仅部分更改了。 存储库的大小保持不变(8 Gig),但是应该减小到4Gig。

有两件事: 首先,有人知道产生这种混合结果的原因是什么? 我在git CMD上在Win10上运行此程序,没有管理员权限。 第二,这样的结果是否“有问题”?我的意思是,有些东西已经改变而有些匆忙。我应该删除然后再次克隆存储库,以便为下一次尝试打下基础吗?

1 个答案:

答案 0 :(得分:1)

  1. 如果引用未更改,则引用的历史记录自首次提交以来就从未包含已删除的文件和目录。
  2. 大小没有变小,因为相关对象仍在存储库中。他们将在那里呆很长时间,直到有一天被垃圾收集。如果它们立即被清除,则表示您不能回滚裁判,以防万一您后悔或误操作git filter-branch