LoginSignup
4
1

More than 5 years have passed since last update.

Gitでmergeで衝突がたくさん起きてもう全部Aで(Bで)いいやというとき

Posted at

マージで衝突したときにAかBか選んでしまうオプション

  • A を選ぶときは --ours
  • B を選ぶときは --theirs

「もう全部 B でいいわ」

git checkout --theirs -- ファイル名

を用います。

git checkout --ours -- ファイル名

を使えばよいです。

git status の unmerged からファイル名を取り出して、

for f in (cat hoge)
  git checkout --theirs -- $f
end

としました。

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