I forked a GitHub project several days ago and from its issues, I can see that the master branch has had some modifications since.
When I cd
to my location directory of this project and use git pull
, it says, "Already up-to-date". Why?
How do I update my fork to include the commits from the original repo?
To sync your forked repo with the parent or central repo on GitHub you: Create a pull request on GitHub.com to update your fork of the repository from the original repository, and. Run the git pull command in the terminal to update your local clone.
Go to your GitHub account, under your forked repository. Click the compare and pull request button. And you are done. Wait for your content to be reviewed, make changes where necessary and your pull request will be merged to the team project.
When you fork a repository, a copy of the original repository is established on your GitHub account. This permits read+write access to the "copy".
When the original repository resource has commits that would benefit your copy, follow these steps to update your fork's master branch. You could update other branches, but typical workflow is to update master
against the original repository.
cd
to your project directorygit remote add upstream <url-of-original-repository>
git branch
and verify you are on master
branchgit pull --rebase upstream master
Step #5 will fetch all new commits of the "original" repository, apply them to master
branch from the last merge-base
, then include all of your branch's commits "on top".
Any time you need to update your fork again, simply run the command in step #5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With