---
name: "gh-auth"
section: "1"
platform: "linux"
package: "github-cli"
version: "2.102.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gh-auth"
---

# gh-auth(1)

Authenticate gh and git with GitHub

## NAME

gh-auth - Authenticate gh and git with GitHub

## SYNOPSIS

**gh auth \<command\> \[flags\]**

## AVAILABLE COMMANDS

- **[gh-auth-login(1)](/gh-auth-login/1.md)**

  Log in to a GitHub account

- **[gh-auth-logout(1)](/gh-auth-logout/1.md)**

  Log out of a GitHub account

- **[gh-auth-refresh(1)](/gh-auth-refresh/1.md)**

  Refresh stored authentication credentials

- **[gh-auth-setup-git(1)](/gh-auth-setup-git/1.md)**

  Setup git with GitHub CLI

- **[gh-auth-status(1)](/gh-auth-status/1.md)**

  Display active account and authentication state on each known GitHub host

- **[gh-auth-switch(1)](/gh-auth-switch/1.md)**

  Switch active GitHub account

- **[gh-auth-token(1)](/gh-auth-token/1.md)**

  Print the authentication token gh uses for a hostname and account

## EXIT CODES

0: Successful execution

1: Error

2: Command canceled

4: Authentication required

NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

## SEE ALSO

**[gh(1)](/gh/1.md)**
