Git の正しいマージがわからん
master の同じ時点から b1, b2, b3 のブランチを切って、それぞれ変更する。
それぞれのブランチを master にマージする。
$ git rebase b1 master
$ git checkout b2
$ git merge master
$ git rebase b2 master
$ git checkout b3
$ git merge master
$ git rebase b3 master
$ git log --graph
* commit b68d9249d1106176e54b9fdafdb8719632c517f7
|\ Merge: 80f57b5 e0433df
| | Author: hokorobi <hokorobi@.(none)>
| | Date: Wed Nov 4 23:31:53 2009 +0900
| |
| | Merge branch 'master' into b3
| |
| * commit e0433df06f105ef9710a411b916256eacc3f3606
| |\ Merge: d77ec87 ed1d023
| | | Author: hokorobi <hokorobi@.(none)>
| | | Date: Wed Nov 4 23:31:06 2009 +0900
| | |
| | | Merge branch 'master' into b2
| | |
| | * commit ed1d023da16ef84a53e0df973324020925729914
| | | Author: hokorobi <hokorobi@.(none)>
| | | Date: Wed Nov 4 22:37:52 2009 +0900
| | |
| | | b1
| | |
| * | commit d77ec87a923a12c0ada18eca54951c483cea9681
| |/ Author: hokorobi <hokorobi@.(none)>
| | Date: Wed Nov 4 22:38:31 2009 +0900
| |
| | b2
| |
* | commit 80f57b5b9793a4a7161ac35cbd153be7ef26d7a9
|/ Author: hokorobi <hokorobi@.(none)>
| Date: Wed Nov 4 23:29:56 2009 +0900
|
| b3
|
* commit 2f5d8c4239640a7b6b8b166c6c997c5ca77ca322
Author: hokorobi <hokorobi@.(none)>
Date: Wed Nov 4 22:37:25 2009 +0900
aこんな感じになるけど、いいんだろうか?
merge を入れないでそのまま rebase すると
$ git rebase b1 master
$ git rebase b2 master
$ git rebase b3 master
$ git log --graph
* commit 1d5c70ad9adee1904f823e08f2655137242d9060
| Author: hokorobi <hokorobi@.(none)>
| Date: Wed Nov 4 22:37:52 2009 +0900
|
| b1
|
* commit 0e8f930a9cf0899321a9a4617dad2d276f5ef081
| Author: hokorobi <hokorobi@.(none)>
| Date: Wed Nov 4 22:38:31 2009 +0900
|
| b2
|
* commit 80f57b5b9793a4a7161ac35cbd153be7ef26d7a9
| Author: hokorobi <hokorobi@.(none)>
| Date: Wed Nov 4 23:29:56 2009 +0900
|
| b3
|
* commit 2f5d8c4239640a7b6b8b166c6c997c5ca77ca322
Author: hokorobi <hokorobi@.(none)>
Date: Wed Nov 4 22:37:25 2009 +0900
aというようになる。
こちらの方がきれいだと思うんだけど、git branch --no-merged を実行すると b1, b2 はマージされていないと出る。う〜ん……。
入門 Git とか読まないとダメかな〜。