Files
docs/cli-docs/reference/config/set.md
T
bircni 55c3a392a1 feat: generate the gt command reference from gitea/cli
update_cli_docs.sh runs gt's own generator and lays the pages out for the
site: one directory per command group, front matter, titles, sidebar
order, fenced help text and rewritten links. --released succeeds while no
series is documented. A weekly workflow proposes updates like the runner's.

Signed-off-by: bircni <[email protected]>
2026-10-22 11:28:15 +02:00

81 lines
3.3 KiB
Markdown

---
sidebar_position: 4
description: "Change a setting"
---
# gt config set
<!-- Generated by update_cli_docs.sh from the gitea/cli sources, do not edit. -->
Change a setting
## Synopsis
```text
Change a preference, an instance setting (--host) or an account setting (--host and --user).
Preferences:
default_host instance to use when no flag or repository selects one
git_protocol https or ssh, for clones and remotes
editor command that edits bodies and messages, such as "code --wait"
prompt enabled or disabled; disabled turns prompts off
pager command that pages long output on a terminal; GITEA_CLI_PAGER overrides it
browser command that opens URLs; never disables opening
color auto, always or never
hyperlinks auto, always or never, for clickable links in terminals
markdown auto renders Markdown on a terminal, raw prints the source
remote Git remote used to find the repository of a clone
http_timeout longest wait for the instance to answer a request, such as 30s, or for more
data while a transfer stalls; 0 waits as long as it takes; a transfer that
keeps moving and migrations are not cut off. The wait for an answer starts
once an upload has reached the instance's machine, so an instance that reads
uploads slowly from its connection needs a longer timeout
Instance settings: user (active account), ssh_host, insecure, git_protocol, oauth_client_id,
and headers: "Name: value" adds a header to every API request to the instance, such as an
access proxy needs, "Name:" removes it, and a value of $NAME or ${NAME} is read from that
environment variable when sent; client_cert and client_key name the PEM files of a TLS client
certificate for an instance that requires one; without client_key, the key is read from
client_cert.
Account settings: ssh_key, ssh_agent, ssh_certificate_principal, ssh_key_fingerprint.
```
```
gt config set <key> <value> [flags]
```
## Examples
```
$ gt config set editor "code --wait"
$ gt config set ssh_host git.example.com:2222 --host https://example.com
$ gt config set ssh_key ~/.ssh/id_ed25519 --host https://example.com --user alice
```
## Options
```
-h, --help help for set
```
## Options inherited from parent commands
```
--cwd directory Working directory for repository discovery
--debug Log the method, URL, status, and duration of each HTTP request to stderr
--host URL Gitea instance URL, including any base path
--interactive Allow prompts with machine output
-q, --jq expression Filter JSON output using a jq expression; implies --json
--json fields[="*"] Output JSON with the specified comma-separated fields, or all fields
--no-input Disable prompts and implicit editor/browser interactions
--remote remote Git remote used for repository discovery
-R, --repo OWNER/REPO Select a repository as OWNER/REPO or URL
--sudo user Perform API requests as this user (requires an administrator account)
--user name Account name on the selected instance
-y, --yes Accept confirmations without prompting
```
## SEE ALSO
* [gt config](../config/index.md): Manage settings