如何在镜像存储库上执行交互式变基(rebase -i)

问题描述 投票:0回答:1

当我尝试对通过镜像创建的存储库进行交互式变基时,我遇到了一些问题。

情况。原始存储库已创建:

git clone --mirror https://github.com/dashboard3.0.git

但是,许多垃圾提交已进入此镜像存储库(因此它不再是镜像)。

问题: 我尝试使用此链接进行变基: 删除特定提交

但是因为这是一个镜像仓库,所以它不起作用。以下是我采取的步骤。我输入命令 git

rebase -i HEAD~15

下面是错误:

关于如何继续的任何想法。我很紧张继续。

git git-rebase
1个回答
0
投票

如果有人感兴趣,我通过采取更积极的方法解决了这个问题。我决定将所有提交减少为 1 并重新开始。

我使用了这些命令:

git log > original.log # Save git log history.
git checkout --orphan new-master master
git commit -m "New initial commit for the <insert repo here>."
git branch -M new-master master
git push origin -f
© www.soinside.com 2019 - 2024. All rights reserved.