How to fork a repository on GitHub

Updated · DeskHowTo

On GitHub.com (verified 2026-10-24), open the repository → click Fork → choose your user/org destination → create the fork. Clone your fork, add the original repo as upstream remote when you need updates, then fetch/merge or use Sync fork on GitHub’s UI.

Forks are for contributing or experimenting — they are not a backup strategy for private company code you should not copy. Respect licenses and contributor guidelines.

Jump to

Applies to public repos you are allowed to fork and private repos where forking is enabled. Organization policies may block forks. Educational contributing workflow only.

Fork, clone and sync

Fork on GitHub

  1. Open the upstream repository on GitHub.
  2. Click Fork (top right).
  3. Choose owner (you or an org) → Create fork.

Clone your fork

  1. On your fork, click Code → copy HTTPS/SSH URL.
  2. Locally: git clone <your-fork-url>.
  3. Add upstream: git remote add upstream <original-url> when you plan to sync.

Keep the fork updated

  1. On GitHub: open your fork → Sync fork when commits are behind.
  2. Or fetch upstream locally and merge/rebase per the project’s guide.
  3. Open PRs from a branch on your fork toward upstream.

Our take: branch on the fork, PR to upstream

Never commit feature work on your fork’s default branch if you sync often — use topic branches.

If it fails

  • Fork button missing: repo disabled forks, or you lack login/SSO authorization.
  • Sync conflicts: resolve locally; prefer project’s documented sync method.
  • Org cannot fork private: billing/policy — ask an org owner.
  • PR from wrong remote: confirm git remote -v points origin at your fork.

Frequently asked questions

What does forking a GitHub repo do?

It creates a copy of the repository under your account so you can push changes without writing to the original.

How do I update my fork?

Use Sync fork on GitHub or fetch/merge from the upstream remote locally.

Fork vs branch?

A branch lives inside one repo; a fork is a separate copy under another user/org.

Can I fork a private repository?

Only when the owner allows forking and you have access — many company repos disable it.

Do I need a fork to open a PR?

For repos you cannot push to, yes — fork, push a branch, then open a pull request upstream.

Sources checked: GitHub Docs: Fork a repo, GitHub Docs: Syncing a fork. Verified October 2026.