- Open TerminalTerminalGit Bash.
- 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)
Explore by product
GitHub
Get startedGitHubEnterprise administratorsBilling and paymentsOrganizationsCode securityGitHub IssuesGitHub ActionsGitHub CodespacesGitHub PackagesDevelopersREST APIGraphQL APIGitHub InsightsGitHub DiscussionsGitHub SponsorsBuilding communitiesGitHub PagesEducationGitHub DesktopGitHub CLIAtomElectronCodeQL
This version of GitHub Enterprise was discontinued on 2021-06-09. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.
Article version: Enterprise Server 2.21
Article version: Enterprise Server 2.21
Configuring a remote for a fork
You must configure a remote that points to the upstream repository in Git to sync changes you make in a fork with the original repository. This also allows you to sync changes made in the original repository with the fork.