---
name: "gt-auth-setup-git"
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-auth-setup-git"
---

# gt-auth-setup-git(1)

Configure git to use gt for credentials

## NAME

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

## SYNOPSIS

**gt auth setup-git \[flags\]**

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

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.

## OPTIONS

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

## OPTIONS INHERITED FROM PARENT COMMANDS

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

## EXAMPLE

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

## SEE ALSO

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