Look for a message like this. If it says that your default branch is behind the upstream's default branch (usually master
), it means there are updates:
Clone your fork to your local machine OR cd
to it:
git clone https://github.com/[your-username]/[fork-repository].git # or [email protected]:[your-username]/[fork-repository].git
# OR
cd fork-repository/
See if there's an upstream remote or not.
git remote -v
If there is no upstream remote, then run the following. Else, skip this step.
git remote add upstream https://github.com/[original-owner]/[original-repository].git
Grab updates from the remote:
git fetch upstream
Get onto your fork's default branch (or create a new branch off of your fork's default branch for this merge specifically):
git checkout [default-branch]
Merge upstream to your fork's local branch:
git merge upstream/[upstream's-default-branch]
Make sure there's no merge conflicts. It can also be helpful to run the tests locally and test as much as possible locally, so you know if there’ll be any breaking changes. If the fork requires packages to be built, make sure to build changes the packages with the new changes before committing to the origin's default branch.
git push