One use case is a fork of a repository as in Section 86.17 (with upstream added as an alias for the remote). For this case the GitHub interface has a Fetch upstream option to merge any upstream commits into the current branch.
Another use case is that someone has forked your repository (and you’ve added downstream as an alias for that remote).
First list the named remotes that you may have previously added using remote:
git remote -v
If the remote repository of interest is called upstream then the next step is to fetch updates from the remote:
git fetch upstream
Finally, merge any changes from the remote repository into your local branch:
git merge upstream/main
You may need to resolve any conflicts or else lodge a pull request to the remote and get them to resolve them, though that would be less polite.
Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0