1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

#Github PR で master develop ブランチなどがコンフリクトした時にマージ用の PR を作成する

Last updated at Posted at 2019-11-30

image

問題

  • develop から master にマージしたい
  • master <- develop に向けてPRを作成するとコンフリクトする
  • devlopは直接 push できない
  • masterは直接 push できない

どうする?

  • master <- develop を実現するために、develop の状態を直接変えるのではなく、developからの派ブランチを master にマージすれば良い
  • developからの派生ブランチで master 向けの conflict を解消してマージすれば、 master <- develop をしなくても、コミット状態の辻褄は合う
  • ほとんどこのconflict解消作業をしたことがないので、概念が掴めていなかったが、なんだか分かった気がする

手順

  • developから派生させたブランチをてきとうな名前で作成する ( 例 develop-to-master )
  • develop-to-master から masterに向けて merge して merge コミットを作成する
  • develop-to-master のコミットは develop + merge コミット一個の状態になる

  • git checkout develop
  • git checkout -b develop-to-master
  • git merge master

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

1
0
0

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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?