目次
1. 概要
- git-flowにおいて、Developブランチ作成当時よりも進んでしまったmainブランチのコミットを、Developブランチに取り込む時の挙動を確認したい。
- 取り込む際の手段として、
merge / rebaseの2パターンが考えられ、各々の違いを知るのが目的。
2. Developブランチマージ前
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showBranches': true, 'showCommitLabel':true,'mainBranchName': 'Main'}} }%%
gitGraph
commit id:"Release 221203"
commit id:"Release 221210"
branch Develop
commit id:"add) Instagram Button"
checkout Main
commit id:"Release 221217"
checkout Develop
commit id:"refactor) Button Name"
3. merge実行時
- これまでのDevelopブランチのコミットIDは
維持(変わらない)。
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showBranches': true, 'showCommitLabel':true,'mainBranchName': 'Main'}} }%%
gitGraph
commit id:"Release 221203"
commit id:"Release 221210"
branch Develop
commit id:"add) Instagram Button"
checkout Main
commit id:"Release 221217"
checkout Develop
commit id:"refactor) Button Name"
merge Main
4. rebase実行時
- これまでのDevelopブランチのコミットIDは
変更(新しく採番される)。
%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showBranches': true, 'showCommitLabel':true,'mainBranchName': 'Main'}} }%%
gitGraph
commit id:"Release 221203"
commit id:"Release 221210"
commit id:"Release 221217"
branch Develop
commit id:"add) Instagram Button **"
checkout Develop
commit id:"refactor) Button Name **"