-
Open your terminal or Git Bash.
-
List the remotes currently configured for your fork.
$ git remote -v > origin https://github.com/YOUR-USERNAME/YOUR-FORK.git (fetch) > origin https://github.com/YOUR-USERNAME/YOUR-FORK.git (push) -
Add a new remote named upstream that points to the original repository.
git remote add upstream https://github.com/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git -
Verify the new upstream repository that you specified for your fork.
$ git remote -v > origin https://github.com/YOUR-USERNAME/YOUR-FORK.git (fetch) > origin https://github.com/YOUR-USERNAME/YOUR-FORK.git (push) > upstream https://github.com/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (fetch) > upstream https://github.com/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (push)
Configuring a remote repository for a fork
Set up a remote pointing to the upstream repository in Git to sync changes between your fork and the original repository.