To sync changes you make in a fork with the original repository, you must configure a remote that points to the upstream repository in Git.
- Open Terminal (for Mac and Linux users) or the command line (for Windows users).
-
List the current configured remote repository for your fork.
git remote -v # origin https://hostname/YOUR_USERNAME/YOUR_FORK.git (fetch) # origin https://hostname/YOUR_USERNAME/YOUR_FORK.git (push)
-
Specify a new remote upstream repository that will be synced with the fork.
git remote add upstream https://hostname/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
-
Verify the new upstream repository you've specified for your fork.
git remote -v # origin https://hostname/YOUR_USERNAME/YOUR_FORK.git (fetch) # origin https://hostname/YOUR_USERNAME/YOUR_FORK.git (push) # upstream https://hostname/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch) # upstream https://hostname/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)