# gh repo fork

Fork and set up remotes in one step.

## Quick answer
```
gh repo fork cli/cli --clone
```

## Syntax
```
gh repo fork [<repository>] [-- <git-clone-flags>] [flags]
```

## Examples

# Fork a repo and clone it locally
gh repo fork cli/cli --clone

# Fork the repo you're already inside
gh repo fork

# Fork into an organization
gh repo fork cli/cli --org my-team --clone

# Fork with a custom name
gh repo fork cli/cli --fork-name my-cli --clone

## Key flags

  --clone	Clone the new fork after creating it.
  --remote	Add a git remote for the fork in the current repo.
  --remote-name	Name for the fork remote (default "origin").
  --org	Create the fork in the given organization.
  --fork-name	Rename the forked repository.
  --default-branch-only	Only include the default branch in the fork.

Full guide: https://ghcli.com/gh-repo-fork.php
