gh repo fork

Fork someone else's repository

What it does

A fork is a copy of someone else's repository in your account: you can push to it and offer changes to the author through a pull request. gh repo fork owner/repository creates the fork on GitHub, and --clone clones it right away.

After cloning, origin points to your fork and upstream to the original. Run gh repo fork with no name inside a repository you have already cloned, and gh forks it and offers to add the fork as a remote.

Syntax

gh repo fork <owner>/<repository> --clone
gh repo fork

Examples

Related commands

Practise · All commands