Most of the time, after forking and working on a project other pull requests are being merged which leaves your copy behind the current state of the project.
This post walks you through a simple guide on how to sync your fork.
1. Add remote from the original project repo
This is the remote URL to the original project which you want to update your fork from.
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
Now check if upstream has been added
git remote -v
This will list the remote url's active in the local repo
2. Updating fork from the original repo
Run the below command to make a pull.
git pull upstream master
This pulls changes from the original repo and merges it into your local copy. And after this is happy coding :)
Top comments (0)