.nh .TH "GT-REPO-CLONE" "1" "Nov 2026" "gitea-cli" "gitea-cli Manual" .SH NAME gt-repo-clone - Clone a repository locally .SH SYNOPSIS \fBgt repo clone [] [-- ...] [flags]\fP .SH DESCRIPTION Clone a repository with gt's credentials, over the protocol of a URL argument, else the configured Git protocol. Git flags can follow --. A fork's parent is added as the "upstream" remote (or the --upstream-remote-name one), and gt commands in the clone then target the parent; with remote names other than upstream and origin, it is saved as with gt repo set-default. A pull mirror's source is added as the "source" remote; gt commands keep targeting the mirror. An HTTPS clone keeps the instance's stored TLS client certificate and --insecure setting in its Git configuration; GITEA_INSTANCE_INSECURE applies to the clone only. With --find-instance, when no instance is selected and accounts exist on several, the repository is looked up on each of them; if more than one has it, gt asks which to clone from, or fails without prompts. The lookup sends the repository name to every instance with an account. .SS ARGUMENTS .EX A repository can be supplied as NAME (one of yours), OWNER/NAME, HOST/OWNER/NAME or a URL. .EE .SS JSON FIELDS .EX 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 .EE .SH OPTIONS \fB-d\fP, \fB--depth\fP=0 Number of commits to fetch (0: full history) .PP \fB--find-instance\fP[=false] Look the repository up on each instance with an account when none is selected .PP \fB-h\fP, \fB--help\fP[=false] help for clone .PP \fB--no-upstream\fP[=false] Do not add a remote for the parent of a fork or the source of a mirror .PP \fB-u\fP, \fB--upstream-remote-name\fP="upstream" Remote name for the parent of a fork .SH OPTIONS INHERITED FROM PARENT COMMANDS \fB--csv\fP[=""] Output CSV with the specified comma-separated \fBfields\fR, or all fields .PP \fB--cwd\fP="" Working \fBdirectory\fR for repository discovery .PP \fB--debug\fP[=false] Log the method, URL, status, and duration of each HTTP request to stderr .PP \fB--host\fP="" Gitea instance \fBURL\fR, including any base path .PP \fB--interactive\fP[=false] Allow prompts with machine output .PP \fB-q\fP, \fB--jq\fP="" Filter JSON output using a jq \fBexpression\fR; implies --json .PP \fB--json\fP[=""] Output JSON with the specified comma-separated \fBfields\fR, or all fields .PP \fB--no-input\fP[=false] Disable prompts and implicit editor/browser interactions .PP \fB--sudo\fP="" Perform API requests as this \fBuser\fR (requires an administrator account) .PP \fB--template\fP="" Format JSON output using a Go \fBtemplate\fR; implies --json (see gt help formatting) .PP \fB--user\fP="" Account \fBname\fR on the selected instance .SH EXAMPLE .EX # Clone a repository into ./project $ gt repo clone alice/project # Clone into another directory with the last commit only $ gt repo clone alice/project src --depth 1 # Clone from whichever instance with an account has the repository $ gt repo clone alice/project --find-instance # Clone over SSH whatever the configured Git protocol $ gt repo clone git@gitea.com:alice/project.git # Pass flags to git clone $ gt repo clone alice/project -- --branch develop --recurse-submodules .EE .SH SEE ALSO \fBgt-repo(1)\fP