gh repo clone

Clone a GitHub repository by its short name

What it does

gh repo clone does what git clone does, but owner/repository is enough instead of the full URL. Leave out the owner and gh uses your account: gh repo clone shop.

When you clone your fork, gh adds a remote upstream pointing to the original repository, so you can pull its updates. Flags for git clone go after --: gh repo clone anna/shop -- --depth 1.

Syntax

gh repo clone <owner>/<repository>
gh repo clone <repository> <folder>

Examples

Related commands

Practise · All commands