Since you can't change the source branch in github (you can only change the target branch), you need to update the source-branch "inplace".
This answer contains three ways of doing this.
In Github you see:
githubuser wants to merge N commit into master from "source-branch"
Since you will change the history of "source-branch", be sure nobody else is using this branch!
Rewrite history of source-branch
If you are the only one developing on this branch, then you can use git rebase -i and later git push --force-with-lease.
This way you can rewrite the history of this branch.
Docs about rewriting the git history: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
Rename temporary branch to source-branch
If you prefer to start from scratch.
git checkout master # create a temporary branch git checkout -b tmp-branch ... now modify the tmp-branch the way you want to. Commit, but don't push. # rename tmp-branch to "source-branch" git branch -f -m source-branch # Be sure nobody is using "source-branch", since the history gets rewritten. git push --force-with-lease
git rebase --onto
Imagine your branch "source-branch" was accidentely based on "release" and not on "master". But the github target branch is "master". This way you can change your changes to be on top of master:
git checkout source-pr git rebase --onto master release