.nh .TH "GT-AUTH-SETUP-GIT" "1" "Nov 2026" "gitea-cli" "gitea-cli Manual" .SH NAME gt-auth-setup-git - Configure git to use gt for credentials .SH SYNOPSIS \fBgt auth setup-git [flags]\fP .SH DESCRIPTION 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. .PP 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. .SH OPTIONS \fB-h\fP, \fB--help\fP[=false] help for setup-git .PP \fB--keep-helpers\fP[=false] Keep other credential helpers for the instance; they are asked first and store gt's token .PP \fB--local\fP[=false] Configure only the current Git repository instead of global Git configuration .SH OPTIONS INHERITED FROM PARENT COMMANDS \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--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--user\fP="" Account \fBname\fR on the selected instance .SH EXAMPLE .EX $ 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 .EE .SH SEE ALSO \fBgt-auth(1)\fP