gh repo fork Make your own copy of someone else's repository
Creates a fork of a repository under your account. Used inside a clone, it also adds a remote for your fork so you can push there and open pull requests back.
Synopsis
gh repo fork [REPOSITORY] [FLAGS]
Common options
| Option or form | What it does |
|---|---|
--clone | Clone the fork afterwards |
--remote | Add a remote for the fork to the current repository |
--remote-name NAME | Name for that remote (default: origin) |
--org NAME | Create the fork in an organisation |
--fork-name NAME | Give the fork a different name |
--default-branch-only | Copy only the default branch |
Examples
gh repo fork octocat/Hello-World --clone
gh repo fork --remote
gh repo fork octocat/Hello-World --org acme
gh repo fork octocat/Hello-World --default-branch-only --clone
Notes
- After a fork, the original is usually the remote called upstream and your copy is origin.
- Update your fork from the original with gh repo sync.
- Then open a pull request back to the original with gh pr create.
See also
Last reviewed 2026-10-09.