git:如何在本地分支A之上的远程分支B中发现交互式rebase提交?



我基本上想交互式地重新设置remote-branch-b中的2个更改(shaas 1a28dba和be7c442),位于local-branch-a之上,以便我可以将它们推送到remote-branch-a。

我尝试了这个(以及其他一些变化);然而,我正在寻找的更改没有应用在rebas之后。e;我想我有local-branch-b

git rebase -i --onto local-branch-a remote-branch-b

交互会话的结果很奇怪;不确定noop是;然而,shaas是正确的(即Rebase 10b67a636..10b67a636到8d00e80c2(1命令)):

noop
# Rebase 10b67a636..10b67a636 onto 8d00e80c2 (1 command)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup [-C | -c] <commit> = like "squash" but keep only the previous
#                    commit's log message, unless -C is used, in which case
#                    keep only this commit's message; -c is same as -C but
#                    opens the editor
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# .       create a merge commit using the original merge commit's
# .       message (or the oneline, if no original merge commit was
# .       specified); use -c <commit> to reword the commit message
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#

如有任何帮助,不胜感激。

你应该这样运行:

git rebase --onto remote-branch-a remote-branch-b~2 remote-branch-b

如果你真的需要做一些与它交互的事情,请使用-i

更新:也许你想跑的是:

git rebase --onto remote-branch-a local-branch-a remote-branch-b

如果local-branch-a比remote-branch-b慢2个版本

最新更新