9

I keep the repositories of several open source projects locally for reference. I update them infrequently and the result is that I end up with merge conflicts. When it comes to the Linux kernel this can be hundreds of files.

How can I tell git to pull from upstream and accept all changes blindly?

ruipacheco
  • 15,025
  • 19
  • 82
  • 138
  • I think the question this has been marked duplicate of is not accurate. This question is perhaps the real duplicate https://stackoverflow.com/q/1628088/1148030 and has the correct answer. – Peter Lamberg Mar 31 '20 at 07:55

1 Answers1

7

git pull --strategy theirs should have you covered :)

BlueSpaceCanary
  • 411
  • 3
  • 6
  • On my git version 2.25.1 this does not work. It gives `Could not find merge strategy 'theirs'` Maybe it existed in an older version of git? – Peter Lamberg Mar 31 '20 at 07:59
  • I think now it would be `git pull --strategy recursive --strategy-option=theirs` aka `git pull -s recursive -Xtheirs` – BlueSpaceCanary Aug 19 '21 at 01:45