我试图一起冷静几个提交.我用的时候
git rebase –i HEAD~8
Run Code Online (Sandbox Code Playgroud)
我致命了:
fatal: Needed a single revision
invalid upstream –i
Run Code Online (Sandbox Code Playgroud)
这是提交日志的一部分: git log
相应的Github存储库的所有提交历史记录都在这里:https: //github.com/yikouniao/YukiLog/commits/master
当我使用git时rebase –i HEAD~2,我得到了相同的结果.
我不知道我修改了文件.gitconfig,editor = notepad2被添加到文件中.删除后editor = notepad2,一切正常.然后我重新成功并且成功地完成了8次提交.
Cod*_*ard 70
几个选项:
你不是在一个分支(Detached head)或者你正在尝试rebase或错误的分支.
检查您想要的分支,rebase然后重试.
你的历史上没有8次提交(你有7或更少)
尝试: git rebase -i --root
这是该--root标志的文档以及它为什么适合您.
- 根
Rebase all commits reachable from <branch>, instead of limiting them with
an <upstream>.This allows you to rebase the root commit(s) on a branch.
When used with --onto, it will skip changes already contained in `<newbase>`
(instead of `<upstream>`) whereas without --onto it will operate on every
change. When used together with both --onto and --preserve-merges, all root
commits will be rewritten to have `<newbase>` as parent instead.`
Run Code Online (Sandbox Code Playgroud)
Dav*_*gal 12
问题是您的 –i 中的破折号。它是一个短划线 (U2013) 而不是连字符 (U002D)。我通过复制您的破折号并在http://unicode.scarfboy.com 上查找来确认这一点。改为 -i 。
线索是错误消息“上游无效 -i”。Git 没有将您的 –i 识别为标志,而是将其解释为上游参数。
| 归档时间: |
|
| 查看次数: |
41957 次 |
| 最近记录: |