GT-AUTH-SETUP-GIT(1) gitea-cli Manual GT-AUTH-SETUP-GIT(1)

gt-auth-setup-git - Configure git to use gt for credentials

gt auth setup-git [flags]

Configure git to ask gt for the credentials of an instance, so that git push and fetch over HTTPS use the active account, or the account of --user. gt's own clone and checkout commands do not need this. The instance's stored TLS client certificate and --insecure setting are configured for git too; GITEA_INSTANCE_INSECURE is never saved, and keeps an earlier --insecure setting in Git's configuration.

Other credential helpers, such as a system keychain, are turned off for the instance: otherwise they answer first and keep a copy of gt's token. --keep-helpers keeps them.

-h, --help[=false] help for setup-git

--keep-helpers[=false] Keep other credential helpers for the instance; they are asked first and store gt's token

--local[=false] Configure only the current Git repository instead of global Git configuration

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

--sudo="" Perform API requests as this user (requires an administrator account)

--user="" Account name on the selected instance

$ gt auth setup-git
$ gt auth setup-git --host gitea.com
# Only for the current repository, always as alice
$ gt auth setup-git --local --user alice

gt-auth(1)

Nov 2026 gitea-cli