Skip to content

Instantly share code, notes, and snippets.

@diresi
Created January 18, 2019 09:19
Show Gist options
  • Save diresi/a9f0bd3f68e76d0576be4a709ee421ba to your computer and use it in GitHub Desktop.
Save diresi/a9f0bd3f68e76d0576be4a709ee421ba to your computer and use it in GitHub Desktop.
git-mergetool-remerge
# see https://stackoverflow.com/questions/54233117/git-cherry-pick-manually-accept-our-or-their-hunks-in-conflicted-files)
# run with git mergetool --tool=remerge-{ours,theirs} -- <path/to/file>
[mergetool "remerge-ours"]
cmd = git merge-file --ours "$LOCAL" "$BASE" "$REMOTE" && mv -- "$LOCAL" "$MERGED"
trustExitCode = true
[mergetool "remerge-theirs"]
cmd = git merge-file --theirs "$LOCAL" "$BASE" "$REMOTE" && mv -- "$LOCAL" "$MERGED"
trustExitCode = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment