Skip to content

Rebasing a stack after a PR is squashed merged doesn't work properly #378

@geofflamrock

Description

@geofflamrock

It seems like sometimes it does, but most of the time it results in needing to resolve conflicts on lots of commits.

Theory on fixing:

  • Find the branch that was squashed merged as per now (lowest branch in the line that is no longer active - remote deleted or PR now merged)
  • Find the sha of the common base between the branch being rebased from (the lowest branch in the line) - this should give us the most recent commit from the parent branch that also exists in the one being rebased.
  • Check if that sha exists in the branch being rebased onto (prob the source branch e.g. main)
  • If it doesn't then we run git rebase --onto {sourceBranch} {sha} which should work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions