-
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)
CARVIEW |
Select Language
HTTP/2 301
content-length: 0
location: https://docs.github.com/articles/configuring-a-remote-for-a-fork/
HTTP/2 301
access-control-allow-origin: *
content-security-policy: default-src 'none';prefetch-src 'self';connect-src 'self';font-src 'self' data:;img-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com data: placehold.it;object-src 'self';script-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com 'self' data: 'unsafe-inline';script-src-attr 'self';frame-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com https://support.github.com https://www.youtube-nocookie.com;frame-ancestors 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com;style-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com 'self' 'unsafe-inline' data:;child-src 'self';manifest-src 'self';upgrade-insecure-requests;base-uri 'self';form-action 'self'
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: same-origin
origin-agent-cluster: ?1
referrer-policy: no-referrer-when-downgrade
x-content-type-options: nosniff
x-dns-prefetch-control: off
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-xss-protection: 0
cache-control: public, max-age=60
location: /articles/configuring-a-remote-for-a-fork
content-type: text/plain; charset=utf-8
x-github-backend: Kubernetes
x-github-request-id: C727:1A7B68:103FFA2:1506884:68EDDCE1
accept-ranges: bytes
age: 0
date: Tue, 14 Oct 2025 05:17:22 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210089-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1760419041.028947,VS0,VE1317
vary: Accept
strict-transport-security: max-age=31557600
content-length: 75
HTTP/2 302
access-control-allow-origin: *
content-security-policy: default-src 'none';prefetch-src 'self';connect-src 'self';font-src 'self' data:;img-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com data: placehold.it;object-src 'self';script-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com 'self' data: 'unsafe-inline';script-src-attr 'self';frame-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com https://support.github.com https://www.youtube-nocookie.com;frame-ancestors 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com;style-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com 'self' 'unsafe-inline' data:;child-src 'self';manifest-src 'self';upgrade-insecure-requests;base-uri 'self';form-action 'self'
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: same-origin
origin-agent-cluster: ?1
referrer-policy: no-referrer-when-downgrade
x-content-type-options: nosniff
x-dns-prefetch-control: off
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-xss-protection: 0
cache-control: public, max-age=60
location: /en/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-repository-for-a-fork
content-type: text/plain; charset=utf-8
x-github-backend: Kubernetes
x-github-request-id: 504E:37D31E:10D3E58:1599B78:68EDDCE1
accept-ranges: bytes
age: 0
date: Tue, 14 Oct 2025 05:17:22 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210089-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1760419042.359564,VS0,VE299
vary: accept-language, x-user-language, Accept
strict-transport-security: max-age=31557600
content-length: 134
HTTP/2 200
access-control-allow-origin: *
content-security-policy: default-src 'none';prefetch-src 'self';connect-src 'self';font-src 'self' data:;img-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com data: placehold.it;object-src 'self';script-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com 'self' data: 'unsafe-inline';script-src-attr 'self';frame-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com https://support.github.com https://www.youtube-nocookie.com;frame-ancestors 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com;style-src 'self' github.com *.github.com *.githubusercontent.com *.githubassets.com 'self' 'unsafe-inline' data:;child-src 'self';manifest-src 'self';upgrade-insecure-requests;base-uri 'self';form-action 'self'
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: same-origin
origin-agent-cluster: ?1
referrer-policy: no-referrer-when-downgrade
x-content-type-options: nosniff
x-dns-prefetch-control: off
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-xss-protection: 0
cache-control: public, max-age=60
x-powered-by: Next.js
content-type: text/html; charset=utf-8
x-github-backend: Kubernetes
x-github-request-id: 88EE:1599DD:117E2E1:1666DD4:68EDDCE1
content-encoding: gzip
accept-ranges: bytes
age: 1
date: Tue, 14 Oct 2025 05:17:23 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210089-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1760419043.672007,VS0,VE1250
vary: Accept-Encoding
strict-transport-security: max-age=31557600
content-length: 19267
Configuring a remote repository for a fork - GitHub Docs
Skip to main content
GitHub Docs
Search or ask Copilot
Select language: current language is English
Search or ask Copilot
Open menu
Open Sidebar
Configuring a remote repository 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.