I forked a project, made changes, and created a pull request which was accepted. New commits were later added to the repository. How do I get those commits into my fork?
In your local clone of your forked repository, you can add the original GitHub repository as a \”remote\” (\”Remotings\” are like nicknames for the URLs of repositories – origin is one\”) Then you fetch all the branches from that upstream repository and rebase your work to continue working on the Upstream version: commands that may look like: # Add the remote, call it \”upstream\”:\n\ngit remote add upstream https://github.com/whoever/whatever.git .\n\n# Fetch all the branches of that remote into remote-tracking branches # .\n\ngit fetch upstream paraphrase .\n\nIf you\’re in your main branch: # ## Make sure that\’s what you do: .\n\ngit checkout primary main mainphrase .\n\n# write your main branch so that any commits of yours that # aren\’t already in upstream/main are replayed on top of that other branch: # # .\n\ngit rebase upstream/main .\n\nIf you don\’t want to rewrite the history of your main branch (e.g., because other people may have cloned it) then you should replace the last command with git merge upstream/main. But for making further pull requests as clean as possible, it\’s probably a good idea to reset.\n\nIf you\’ve cloned your branch onto upstream/main you have to force the push to push it to your own forked repository on GitHub. You\’d do so with: git push -f origin main.\n\nWhen you\’ve re-invented it\’s the first time you have to use the -f.