---
name: "gt-repo-fork"
section: "1"
platform: "linux"
package: "gitea-cli"
version: "1.0.0-1"
release: "Arch Linux 2026-11-07"
platforms: ["linux"]
url: "https://carta.tech/man/gt-repo-fork"
---

# gt-repo-fork(1)

Fork a repository

## NAME

gt-repo-fork - Fork a repository

## SYNOPSIS

**gt repo fork \[\<repository\>\] \[-- \<gitflags\>...\] \[flags\]**

## DESCRIPTION

Fork a repository for your account, or into an organization with --org. An existing fork is reported instead of failing.

\--clone clones the fork (Git flags can follow --). Inside a clone of the repository, --add-remote adds the fork as "origin" and renames the current "origin" to "upstream".

### ARGUMENTS

```
A repository can be supplied as NAME (one of yours), OWNER/NAME, HOST/OWNER/NAME or a URL.
Without an argument, the repository of the current Git clone is used.
```

### JSON FIELDS

```
actions_enabled, archived, clone_url, default_branch, description, empty,
fork, forks_count, full_name, id, mirror, mirror_interval, name,
open_issues_count, open_pr_count, original_url, parent, private, ssh_url,
stars_count, template, topics, updated_at, url, website
```

## OPTIONS

**--add-remote**\[=false\]\
 	Add the fork as a remote of the current clone

**--clone**\[=false\]\
 	Clone the fork

**--fork-name**=""\
 	Name of the fork (default: the repository's name)

**-h**, **--help**\[=false\]\
 	help for fork

**--org**=""\
 	Fork into this organization

**--remote-name**="origin"\
 	Name of the fork's remote

## OPTIONS INHERITED FROM PARENT COMMANDS

**--csv**\[=""\]\
 	Output CSV with the specified comma-separated **fields**, or all fields

**--cwd**=""\
 	Working **directory** for repository discovery

**--debug**\[=false\]\
 	Log the method, URL, status, and duration of each HTTP request to stderr

**--host**=""\
 	Gitea instance **URL**, including any base path

**--interactive**\[=false\]\
 	Allow prompts with machine output

**-q**, **--jq**=""\
 	Filter JSON output using a jq **expression**; implies --json

**--json**\[=""\]\
 	Output JSON with the specified comma-separated **fields**, or all fields

**--no-input**\[=false\]\
 	Disable prompts and implicit editor/browser interactions

**--remote**=""\
 	Git **remote** used for repository discovery

**-R**, **--repo**=""\
 	Select a repository as **OWNER/REPO** or URL

**--sudo**=""\
 	Perform API requests as this **user** (requires an administrator account)

**--user**=""\
 	Account **name** on the selected instance

## EXAMPLE

```
# Fork the repository of the current clone and add the fork as origin
$ gt repo fork --add-remote
# Fork a repository into an organization under another name
$ gt repo fork alice/project --org acme --fork-name project-fork
# Fork and clone a repository
$ gt repo fork alice/project --clone -- --depth 1
```

## SEE ALSO

**[gt-repo(1)](/man/gt-repo/1.md)**
