This is the repository from which you have created the fork
git remote add upstream https://github.com/owner/repo.git
git fetch upstream
You always create a feature branch for your PRs, right?
git checkout feature-1
The name of the main branch differs in project, you will most likely find it in contributing guidelines.
Most of the time it will be master
, but many projects use development
.
git rebase upstream/master
Go through the rebase process and resolve potential conflicts. Check your commit line afterwards, it should be straight from the upstream main branch with no further branching and merge commits.
As you have a dedicated branch for your PR, you needn't worry about force pushes. The PR will update itself with new rebased commits.
git push --force origin feature-1