作者热门文章
- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我想运行一个git rebase -i some-hash
。
当我运行它时,出现错误:
You asked to amend the most recent commit, but doing so would make it empty. You can repeat your command with --allow-empty, or you can remove the commit entirely with "git reset HEAD^".
[...]
Could not apply [...]
该错误似乎特定于单个提交,因为 --allow-empty
不是我可以传递给 rebase 的选项。
显然 --keep-empty
是我可以传递给 git rebase
的选项,但它似乎无法解决问题。
我如何 rebase ,并告诉 git,如果 rebase 中的提交最终没有效果,请不要担心?
最佳答案
好像在运行:
git commit --allow-empty
git rebase --continue
创建 2 个压缩的提交,而不是一个。运行 git rebase -i some-hash
允许我将 2 个新提交压缩为一个。
关于git - 我如何 `git rebase -i` 并防止 "You asked to amend the most recent commit, but doing so would make it empty."?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37599665/
我是一名优秀的程序员,十分优秀!