- Open TerminalTerminalGit Bash.
- List the current configured remote repository 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)
- Specify a new remote upstream repository that will be synced with the fork.
$ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
- Verify the new upstream repository you've 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)
No results found.
Explore by product
GitHub
Get startedAccount and profileGitHubEnterprise administratorsBilling and paymentsOrganizationsCode securityGitHub IssuesGitHub ActionsGitHub CodespacesGitHub PackagesDevelopersREST APIGraphQL APIGitHub CLIGitHub DiscussionsGitHub SponsorsBuilding communitiesGitHub PagesEducationGitHub DesktopAtomElectronCodeQL
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.
Help us make these docs great!
All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.
Make a contribution