Skip to content

Instantly share code, notes, and snippets.

@rafeca
Last active May 31, 2019 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafeca/eaa21f7ff1cf78374b2006711f3e003d to your computer and use it in GitHub Desktop.
Save rafeca/eaa21f7ff1cf78374b2006711f3e003d to your computer and use it in GitHub Desktop.
A guide to solve conflicts that appeared on PRs after merging https://github.com/atom/atom/pull/19391

Guide to solve codestyle conflicts

First solve any potential conflicts that your branch had with master before prettier got merged:

$ git merge 677bbb7f0b8754787ff9e7bfab4602ba82e13b0b

Now merge with against the commit that merged the prettier branch:

$ git merge 1d9a4cafcf6cc288d675512db8fd984e13aab869

You can check the files that got conflicts by running:

$ git diff --name-only --diff-filter=U

Most of the conflicts will look something like:

<<<<<<< HEAD
this.addEventListener(this.window, 'correct', this.onCorrect)
=======
this.addEventListener(this.window, 'previous', this.onPrevious);
>>>>>>> 1d9a4c

You just need to make sure that git didn't screw up the detection of the conflict, if that's the case you can just take your changes (the HEAD ones) and discard the incoming changes.

You can get resolve the conflicts from a whole file by running git checkout --ours <filename>, just doublecheck that all the conflicts were detected correctly by git.

Once you resolve all conflicts, you should re-run prettier on your branch to fix all the potential codestyle issues from your changes:

$ script/lint --fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment