LoginSignup
20
20

More than 5 years have passed since last update.

git mergeの履歴の違いを図にして整理してみた

Last updated at Posted at 2015-01-05

これは何?

  • git merge コマンドには、--no-ffオプションや--squashオプションがあり。
  • もう語り尽くされている部分ですが、それらの違いを整理して図にしてみたものです。

前提

  • merge前のブランチは、git rebase masterしておく。

git merge の履歴の違い

git-merge-explain.png

ネットワーク図的な特徴

  • --no-ff : マージコミットが作られる + コミットログのネットワーク図を見ればどこから分岐してどこにマージされたのか視覚的にすぐわかる。
  • --squash : コミットが1つにまとまって綺麗 + コミット履歴が1列になる + masterブランチとの関係性が途切れる
  • オプションなし : コミット履歴が一列になる。(masterブランチとbranchXブランチが同じ位置にくる)
20
20
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
20
20