現在の様子を写真で。緑の枝はマスターです。マスターに触れずに、最後の 3 つのコミットをマスターからピンクのブランチにコピーする方法は?
2 に答える
git checkout <name of pink branch>
git merge master
master
あなたが望むことを正確に行います(からの3つのコミットをピンクのブランチにマージしますが、master
それ自体はそのままにしておきます)。
If you mean you wished you had waited to branch (and it's a personal project branch) you can (from branch "pink") use git rebase master
. That will pop off the pink commits, move pink
ahead to 29934b6 and then re-apply the patches.
Otherwise Amber's git merge
is probably the best answer.
Another possibility is (again, from "pink") git cherry-pick 9a51fd2; ...
for each of those changes. That will make individual new commits on pink. You can also name the branches as master
, master^
and master^^
.