您是否使用(或其他介词)重新定位到另一个分支?

Do you rebase onto, with (or some other preposition) another branch?

我经常听到同事说 我用 master 重新设置了我的分支,但这是 'correct' 的说法吗?你是 rebase 到 ref 还是 rebase 到 ref?两种方式都是acceptable/accurate吗?

如果您在 git/git(Git 源代码)中搜索这两个表达式,您将得到:

对于rebase with

D:\git\git>git grep -i "rebase with"
Documentation/git-pull.txt:When set to `preserve` (deprecated in favor of `merges`), rebase with the
Documentation/git-rebase.txt:- Start an interactive rebase with `git rebase -i <commit>^`, ...
Documentation/git-rebase.txt:- Continue the rebase with `git rebase --continue`.
...

"with a branch" 从未使用过。

关于"rebase on":

po/bg.po:msgid "Cannot rebase onto multiple branches."
po/bg.po:msgid "rebase onto given branch instead of upstream"
po/bg.po:msgid "invalid branch.%s.merge; cannot rebase onto > 1 branch"

所以你显然是在变基到一个分支上,而不是 "with a branch"。

git rebase 命令的定义中:

Reapply commits on top of another base tip