我正在寻找一个适当的解决方案来删除我的存储库历史记录中的 only-timestamp-changes 。
如果您想知道我在这里做什么:我正在尝试基于下载的一款软件的夜间 zip 存档构建一个 git 存储库,其中每天所有文件都带有日期时间戳......但实际上并没有改变。为了保留实际的变化,我想摆脱这些变化。
我已经玩过 filter-branch 来删除子目录。有人知道如何实现这一目标吗?
我还有一些额外的观点:
- 我知道更改总是在特定的行中(如果我从上到下走,如果只触及这一行,我可以删除一个文件的更改?)
- 旧的和新的时间戳——对于一次提交——在所有文件中都是相同的。
- 这条线是全球独一无二的,我会说它甚至是永恒的独一无二。
追加
问题 1:我如何知道哪些文件实际被更改了?
好吧,我举两个例子。第一个实际上包含更改,第二个仅包含冲压。
在我的示例中,时间戳始终位于第 5 行。我的目标是删除提交 A中更改的一行并消除提交 B。
示例提交 A(之前)
a file with a header
a file with a header
a file with a header
/*
Build date: 2013-24-05 11:01:01 (02129bb861061d1a052c592e2dc6b383)
*/
other stuff
other stuff
something before the change
other stuff
示例提交 A(之后)
a file with a header
a file with a header
a file with a header
/*
Build date: 2013-25-05 11:01:01 (57cec4137b614c87cb4e24a3d003a3e0)
*/
other stuff
other stuff
something after the change
other stuff
示例提交 B(之前)
a file with a header
a file with a header
a file with a header
/*
Build date: 2013-24-05 11:01:01 (02129bb861061d1a052c592e2dc6b383)
*/
other stuff
other stuff
something which is not altered
other stuff
示例提交 B(之后)
a file with a header
a file with a header
a file with a header
/*
Build date: 2013-25-05 11:01:01 (57cec4137b614c87cb4e24a3d003a3e0)
*/
other stuff
other stuff
something which is not altered
other stuff