【问题标题】:Git doesn't allow rebase because of unstaged changes when there are noneGit 不允许变基,因为没有分阶段的更改
【发布时间】:2020-06-18 18:34:36
【问题描述】:

当我尝试git rebase 时,我看到以下内容:

Cannot rebase: You have unstaged changes.
Please commit or stash them.

当我尝试git status 时,我看到以下内容:

On branch xxx

nothing to commit, working tree clean

我已经尝试过git resetgit clean -fdgit checkout .

我还能尝试什么?

【问题讨论】:

  • 您之前是否在任何文件上运行过git update-index --assume-unchangedgit update-index --skip-worktree?试试git ls-files -v | grep -e '^h' -e '^S' 找出来。
  • 不,我没有运行这些命令。我试过你的git ls-files 命令,它什么也没返回。我尝试运行git ls-files -v,似乎所有文件都是H
  • 是否有任何文件在当前分支上被忽略并存在于工作树中但在新的基础上提交?
  • 我试过git rebase -i HEAD~1,但它也失败了,我最后一次提交肯定没有引入任何被忽略的文件。

标签: git git-rebase


【解决方案1】:

我放弃并核对了存储库:cd .. && rm -rf <repo> && git clone <repo>

变基现在可以工作了。

【讨论】:

    猜你喜欢
    • 2016-05-11
    • 2016-10-24
    • 2021-04-10
    • 1970-01-01
    • 2013-01-23
    • 1970-01-01
    • 2018-08-20
    • 2012-01-21
    • 1970-01-01
    相关资源
    最近更新 更多