---
name: "gt-repo-set-default"
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-set-default"
---

# gt-repo-set-default(1)

Set the default repository for this clone

## NAME

gt-repo-set-default - Set the default repository for this clone

## SYNOPSIS

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

## DESCRIPTION

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

## EXAMPLE

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

## SEE ALSO

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