Skip to content

Instantly share code, notes, and snippets.

@hi-ogawa
Last active May 30, 2023 05:16
Show Gist options
  • Save hi-ogawa/4640087cc283ea0ddc841df76088087f to your computer and use it in GitHub Desktop.
Save hi-ogawa/4640087cc283ea0ddc841df76088087f to your computer and use it in GitHub Desktop.
follow up after github squash merge

scenario

  • y: main
  • z: PR-1
  • w: PR-2 (based on PR-1)
x - y
  \ 
    z - w

  1. squash-merge z (PR-1) into y (main)

Due to this, Github says "Base automatically changed from PR-1 to main" in PR-2. At this point, z and z' don't have any relations in terms of git history.

x - y - z'
  \
    z - w

  1. git merge z' # from z

The difference between y-z and y-z' are equivalent, so there is no conflict?

x - y - z'
  \       \
    z ----  z''
      \
        w

  1. git merge z'' # from w

main (at z') becomes an ancestor of PR-2 (at w').

x - y - z'
  \       \
    z ----  z''
      \       \
        w ---- w'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment