LoginSignup
10
8

More than 5 years have passed since last update.

git pullでコンフリクトが起きるときに片方の変更だけ適用する

Last updated at Posted at 2015-07-06

  • -Xours/-Xtheirsを指定する
    • 基本的にはmergeのオプションと同じ
    • この際に--no-commitオプションもつけるとマージコミットを行わなくなるのでマージ後の入力を省くことが出来そう
      • その際は別途commitを行う必要がある
      • commitには-mオプションがあるので、エディタからのコミットメッセージの入力は回避可能

手元の変更を適用する場合

$ git pull -Xours repo refspec

pull先の変更を適用する場合

$ git pull -Xtheirs repo refspec

10
8
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
10
8