Skip to content

Instantly share code, notes, and snippets.

@InBrewJ
Created December 24, 2021 11:54
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 InBrewJ/893326a0076ba40e4d556e05b69269a5 to your computer and use it in GitHub Desktop.
Save InBrewJ/893326a0076ba40e4d556e05b69269a5 to your computer and use it in GitHub Desktop.
git rebase: always trust one source of commits for merge conflicts
## See https://stackoverflow.com/a/66766065/8249410
## IN A REBASE, THE MEANING OF OURS / THEIRS IS REVERSED
## Because we're replaying commits over the other branch, the commits you're adding over the
## base branch become 'theirs' wrt the base branch
## capeesh?
## To choose the influence of `origin/main` for rebase conflicts
git rebase -s recursive -X ours origin/main
## To choose the influence of your current branch for rebase conflicts
git rebase -s recursive -X theirs origin/main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment