gt-repo-fork(1)

gt-repo-fork1

Fork a repository

Usage

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

Overview

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

Examples

# 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

From gitea-cli 1.0.0-1 in Arch Linux 2026-11-07. Parsed by carta from the page's man source.