私はgit rebase最近使い始めましたが、正しく使用していると100%確信していません。質問のために、起源には2つのブランチがmasterありnext、はから分岐したものmasterです。
2つの間の最後の同期以降、2つのmasterコミットとnext6つのコミットがありました。
$ git log --oneline origin/next..origin/master
59b5552 master commit #2
485a811 master commit #1
$ git log --oneline origin/master..origin/next
4ebf401 next commit #6
e9b6586 next commit #5
197ada0 next commit #4
4a2c3c6 next commit #3
040a055 next commit #2
84537bf next commit #1
チェックアウトnextして実行するgit rebase -i origin/masterと、次のようになります。
$ git status
# On branch next
# Your branch and 'origin/next' have diverged,
# and have 8 and 6 different commits each, respectively.
そして最後に、を実行した後git pull --rebase、からの2つのコミットmasterがありnextます:
$ git log --oneline origin/next..next
8741d09 master commit #2
485a811 master commit #1
質問:
- これは正しいアプローチですか?
- 実行さ
8 and 6れるまで異なるコミットがあるのはなぜですか?pull --rebase - フローを単純化することは可能ですか?
とても感謝しております :)