如何解决“无法取消链接旧*:没有此类文件或目录”的问题?

时间:2018-12-12 18:52:41

标签: git git-rebase git-squash

我已经从远程存储库克隆了一个分支:

git clone -b feature/feature1 http://.....
git status
    On branch feature/feature1
    Your branch is up to date with 'origin/feature/feature1'
    nothing to commit, working tree is clean

现在我正尝试使用git rebase -i来压缩最后两个提交:

git rebase -i HEAD~3

pick ...
pick ....
squash ...

但是,我遇到此错误:

error: unable to unlink old 'file1': No such file or directory
error: unable to unlink old 'file2': No such file or directory 
error: unable to unlink old 'file3': No such file or directory
hint: Could not execute the todo command
hint:
hint:     squash 3b6cabf2541e333d614c3cd5dbbb82a37037cc14 some commit
hint:
hint: It has been rescheduled; To edit the command before continuing, please
hint: edit the todo list first:
hint:
hint:     git rebase --edit-todo
hint:     git rebase --continue
Could not apply 3b6cabf... some commit

为什么会出现此错误,我该如何解决?

1 个答案:

答案 0 :(得分:1)

您想要的是git rebase --continue