修复 git 历史记录混乱的问题



我不知何故完全搞砸了我的历史,现在我的日志图顶部有这个怪物:

$ git log --oneline --decorate --graph --all | head
*   9287659 (HEAD -> production, origin/production) Merge branch 'master' into production
|
| * 7e7237a (origin/master, origin/HEAD, master) Reports on LaMP validation history now 
* |   a7b2c39 Merge branch 'master' into production
| 
| * | d8f2320 Reports on LaMP validation history now - LaMP/LaMP-Service#31
| |/
* | a8c6183 Reports on LaMP validation history now
|/
* caa80f6 T&M report only includes completed assessments.  Added a 'lab' tab to the download

此时,我的"主"和"生产"分支应该都指向完全相同的东西。 我希望我的图表看起来像这样:

* somenum Reports on LaMP validation history now - LaMP/LaMP-Service#31
* caa80f6 T&M report only includes completed assessments.  Added a 'lab' tab to the download
HEAD、生产、主控、原产地/

生产和原产地/主控都应该指向顶线。

我是唯一有权访问此存储库的人,因此可以覆盖远程存储库。

我尝试对caa80f6进行变基,这只会使情况变得更糟。

由于您是唯一使用它的人,因此变基应该没问题。您可以将提交压缩在一起。

git rebase -i caa80f6我想这就是你想要的。"f"将压缩并丢弃提交消息。

f a8c6183 现在报告
LaMP 验证历史记录选择 d8f2320 关于 LaMP 验证历史记录
的报告f a7b2c39 将分支"主"合并到生产
中f 7e7237a (原产地/主、原产地/头、主(
f 9287659(HEAD ->生产、产地/生产(

最新更新