git 使用 sourcetree 变基
git rebase using sourcetree
我想我对如何使用 SourceTree GUI 进行 git 变基感到困惑。我有两个分支 "master" 和 "dev"。如所见,两个分支分开了。我想在 "dev" 分支上做一个变基,使用命令行,这将是:
git checkout dev
git rebase master
我本来希望右键单击 "dev",然后选择 "Rebase current changes onto dev"。我假设当前的变化意味着 "new commits on master"。但是选择这个选项似乎没有任何效果。正确的步骤是什么?
But picking this option seems have no effect whatsoever.
是的,因为当前的更改是当前分支之一,即dev
。
在 dev
之上重新设置 dev
意味着无操作。
git checkout dev
git rebase master
这意味着:当前分支是 dev
:将在 master
之上重新建立基础。
所以在SourceTree中,你需要右击master
(同时dev
被勾选),然后select:
Rebase current changes onto master
Howe adds :
Current Naming of "rebase current changes onto [branch]
" is misleading. Check out this improvement discussion SRCTREE-1578
.
After finding myself baffled attempting to bring a feature branch up to date with development and failing, I've come to realize that the left-pane context menu item labeled “rebase current changes onto $somebranch
” actually does the opposite of what its name suggests:
it rebases the current branch to the state of $somebranch;
In other words it rebases $somebranch
onto (or into) the current branch, not the other way around. (Right?)
The preposition “onto
” in the current text is misleading; it implies that the object of the sentence ($somebranch
in my example) will receive the changes.
In fact, it is the opposite that will occur.
The absence of the current branch's name adds to the confusion.
A re-wording that improves the sentence structure and includes the name of the affected branch would afford a huge win for clarity.
For example:
rebase $currentbranch to head of $somebranch
rebase $somebranch onto $currentbranch
我想我对如何使用 SourceTree GUI 进行 git 变基感到困惑。我有两个分支 "master" 和 "dev"。如所见,两个分支分开了。我想在 "dev" 分支上做一个变基,使用命令行,这将是:
git checkout dev
git rebase master
我本来希望右键单击 "dev",然后选择 "Rebase current changes onto dev"。我假设当前的变化意味着 "new commits on master"。但是选择这个选项似乎没有任何效果。正确的步骤是什么?
But picking this option seems have no effect whatsoever.
是的,因为当前的更改是当前分支之一,即dev
。
在 dev
之上重新设置 dev
意味着无操作。
git checkout dev
git rebase master
这意味着:当前分支是 dev
:将在 master
之上重新建立基础。
所以在SourceTree中,你需要右击master
(同时dev
被勾选),然后select:
Rebase current changes onto master
Howe adds
Current Naming of "
rebase current changes onto [branch]
" is misleading. Check out this improvement discussionSRCTREE-1578
.After finding myself baffled attempting to bring a feature branch up to date with development and failing, I've come to realize that the left-pane context menu item labeled “
rebase current changes onto $somebranch
” actually does the opposite of what its name suggests:
it rebases the current branch to the state of $somebranch;
In other words it rebases$somebranch
onto (or into) the current branch, not the other way around. (Right?)The preposition “
onto
” in the current text is misleading; it implies that the object of the sentence ($somebranch
in my example) will receive the changes.
In fact, it is the opposite that will occur.
The absence of the current branch's name adds to the confusion.A re-wording that improves the sentence structure and includes the name of the affected branch would afford a huge win for clarity.
For example:rebase $currentbranch to head of $somebranch rebase $somebranch onto $currentbranch