Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
GH-AUTH-SETUP-GIT(1)		GitHub CLI manual	    GH-AUTH-SETUP-GIT(1)

NAME
     gh-auth-setup-git - Setup git with GitHub CLI

SYNOPSIS
     gh auth setup-git [flags]

DESCRIPTION
     This  command configures git to use GitHub CLI as a credential helper.  For
     more information on git credential helpers please reference:

     <https://git-scm.com/docs/gitcredentials>.

     By default, GitHub CLI will be set as the credential helper for all authen-
     ticated hosts.  If there is no authenticated hosts the command  fails  with
     an error.

     Alternatively,  use the --hostname flag to specify a single host to be con-
     figured.  If the host is not authenticated with, the command fails with  an
     error.

OPTIONS
     -f, --force <--hostname>
	    Force  setup even if the host is not known. Must be used in conjunc-
	    tion with --hostname

     -h, --hostname <string>
	    The hostname to configure git for

EXIT CODES
     0: Successful execution

     1: Error

     2: Command canceled

     4: Authentication required

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

EXAMPLE
     # Configure git to use GitHub CLI as the credential helper for all authenticated hosts
     $ gh auth setup-git

     # Configure git to use GitHub CLI as the credential helper for enterprise.internal host
     $ gh auth setup-git --hostname enterprise.internal

SEE ALSO
     gh-auth(1)

				    Aug 2026		    GH-AUTH-SETUP-GIT(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=gh-auth-setup-git&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help