1
0
mirror of synced 2025-12-23 11:54:18 -05:00
Files
docs/content/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork.md
2021-03-17 12:31:29 -07:00

1.7 KiB

title, intro, redirect_from, versions, topics
title intro redirect_from versions topics
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](/articles/syncing-a-fork) with the original repository. This also allows you to sync changes made in the original repository with the fork.
/articles/configuring-a-remote-for-a-fork
free-pro-team enterprise-server github-ae
* * *
pull requests

{% data reusables.command_line.open_the_multi_os_terminal %} 2. List the current configured remote repository for your fork.

$ git remote -v
> origin  https://{% data variables.command_line.codeblock %}/<em>YOUR_USERNAME</em>/<em>YOUR_FORK</em>.git (fetch)
> origin  https://{% data variables.command_line.codeblock %}/<em>YOUR_USERNAME</em>/<em>YOUR_FORK</em>.git (push)
  1. Specify a new remote upstream repository that will be synced with the fork.
$ git remote add upstream https://{% data variables.command_line.codeblock %}/<em>ORIGINAL_OWNER</em>/<em>ORIGINAL_REPOSITORY</em>.git
  1. Verify the new upstream repository you've specified for your fork.
$ git remote -v
> origin    https://{% data variables.command_line.codeblock %}/<em>YOUR_USERNAME</em>/<em>YOUR_FORK</em>.git (fetch)
> origin    https://{% data variables.command_line.codeblock %}/<em>YOUR_USERNAME</em>/<em>YOUR_FORK</em>.git (push)
> upstream  https://{% data variables.command_line.codeblock %}/<em>ORIGINAL_OWNER</em>/<em>ORIGINAL_REPOSITORY</em>.git (fetch)
> upstream  https://{% data variables.command_line.codeblock %}/<em>ORIGINAL_OWNER</em>/<em>ORIGINAL_REPOSITORY</em>.git (push)