【備忘録】git。別のブランチで作業しているときに最新ブランチをマージしたいとき

プログラミング

※プロモーションページが含まれる場合があります

状況

gitで別のブランチで作業しているときに、

[word_balloon id=”mystery_men” size=”M” position=”L” radius=”true” name=”” balloon=”talk” balloon_shadow=”true”]

最新のブランチを更新したから取り込んでおいて―

[/word_balloon]

っていうとき。

[word_balloon id=”unset” src=”https://mutsukichi-cooldciel.com/wp-content/uploads/2021/12/1088f865e73a8476d3f3eb4e589ffe90.png” size=”M” position=”L” radius=”true” name=”” balloon=”talk” balloon_shadow=”true”]

最新のブランチ取り込み方わかんねーし、今の作業コードに変にブランチをマージしたらおかしくなりそう

[/word_balloon]

これでやってます

  1. 作業ブランチで git stash
  2. 作業ブランチからmaster(最新のブランチ)のブランチに移動。
  3. git pull
  4. 作業ブランチに移動
  5. git merge –no-ff [取り込みたいブランチ] で作業ブランチを最新へ
  6. git stash apply でstashを元に戻す

参考サイト:

https://yu8mada.com/2018/08/15/the-difference-between-the-git-merge-options-ff-no-ff-and-ff-only/#content-2

コメント

タイトルとURLをコピーしました