
【プログラミング初心者】 Git入門⑤ -マージ編-
全章ではbranchを新しく作成し、変更を加えました。今回はブランチを結合させてみましょう。
masterブランチに移動
masterブランチにcheckoutしましょう。
test % git checkout master
developブランチを作成
今回はdevelopブランチを作成してfeature/1ブランチをマージしていきます。
test % git branch develop
test % git checkout develop
これでdevelopへのcheckoutが完了しました。
ブランチの結合
test % git merge feature/1
結果
Updating a0d6d21..a8b1d57
Fast-forward
test.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
これでmergeが完了しました。ではtest.txtファイルを閲覧してmergeが完了したかみてみましょう。
merge前(masterの編集されたtest.txt)
merge後(feature/1の編集されたtest.txt)
これでmergeが完了したことが確認できました。