Merge PR base branch into current branch
Git itself does not know "this branch was originally created from that branch". But GitHub, GitLab, and Codeberg know the base branch of the current PR/MR.
Instead of querying external APIs, the current tool I use is
sync-branch. If you use VS Code, it automatically stores
the base branch in your .git/config under branch.<name>.vscode-merge-base. The sync-branch
tool reads this local configuration to reliably determine your parent branch and merge its latest
changes. This is especially handy when working with a chain or train of branches, as it synchronizes
your branch offline without having to explicitly type the base branch name.