git rebase致命:需要单个修订 [英] git rebase fatal: Needed a single revision
问题描述
我有一个公共仓库的分支,我试图用原始仓库中的当前提交来更新我的分支:
I have a branch of a public repository and I am trying to update my branch with the current commits from the original repository:
$ git fetch <remote>
remote: Counting objects: 24, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 20 (delta 12), reused 0 (delta 0)
Unpacking objects: 100% (20/20), done.
From git://github.com/path_to/repo
9b70165..22127d0 master -> $/master
$ git rebase <remote>
fatal: Needed a single revision
invalid upstream <remote>
< remote>
已到位我的远程名称,实际上并不是我的远程名称。关于这个错误的文档似乎有点松动。
The <remote>
is in place of my remote name and is not actually my remote name. The documentation on this error seems to be a bit loose.
推荐答案
您需要提供分支的名称(或其他提交标识符),而不是远程名称 git rebase
。
You need to provide the name of a branch (or other commit identifier), not the name of a remote to git rebase
.
例如:
E.g.:
git rebase origin/master
不是:
git rebase origin
请注意,虽然 origin / HEAD
作为需要提交引用的参数,似乎不是每个存储库都会获得这样的引用,因此它可能不会(并且在您的情况下不会)工作。它是值得明确的。
Note, although origin
should resolve to the the ref origin/HEAD
when used as an argument where a commit reference is required, it seems that not every repository gains such a reference so it may not (and in your case doesn't) work. It pays to be explicit.
这篇关于git rebase致命:需要单个修订的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!