gt-repo-set-default(1)

gt-repo-set-default1

Set the default repository for this clone

Usage

gt repo set-default [<repository>] [flags]

Overview

Set the repository that gt commands use in the current Git clone instead of the one of its Git remotes (saved as gt.repository in the clone's Git configuration). With --remote, it saves the repository of that Git remote.

Arguments

A repository can be supplied as NAME (one of yours), OWNER/NAME, HOST/OWNER/NAME or a URL.
Without an argument or --remote, a terminal asks for one of the repositories of the clone's Git remotes.

Options

-h, --help[=false]
help for set-default

-u, --unset[=false]
Remove the saved default repository

-v, --view[=false]
Print the saved default repository

Options inherited from parent commands

--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

--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

# Make gt commands in this clone use the fork's parent
$ gt repo set-default alice/project
# Save the repository of the upstream remote
$ gt repo set-default --remote upstream
# Show the saved repository
$ gt repo set-default --view
# Go back to the repository of the Git remotes
$ gt repo set-default --unset

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