1GH-AUTH-SETUP-GIT(1) GitHub CLI manual GH-AUTH-SETUP-GIT(1)
2
3
4
6 gh-auth-setup-git - Setup git with GitHub CLI
7
8
9
11 gh auth setup-git [flags]
12
13
14
16 This command configures git to use GitHub CLI as a credential helper.
17 For more information on git credential helpers please reference:
18 https://git-scm.com/docs/gitcredentials.
19
20
21 By default, GitHub CLI will be set as the credential helper for all au‐
22 thenticated hosts. If there is no authenticated hosts the command
23 fails with an error.
24
25
26 Alternatively, use the --hostname flag to specify a single host to be
27 configured. If the host is not authenticated with, the command fails
28 with an error.
29
30
31
33 -h, --hostname <string>
34 The hostname to configure git for
35
36
37
39 # Configure git to use GitHub CLI as the credential helper for all authenticated hosts
40 $ gh auth setup-git
41
42 # Configure git to use GitHub CLI as the credential helper for enterprise.internal host
43 $ gh auth setup-git --hostname enterprise.internal
44
45
46
47
48
50 gh-auth(1)
51
52
53
54 Oct 2023 GH-AUTH-SETUP-GIT(1)