1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/gh-auth.md

33 lines
773 B
Markdown
Raw Normal View History

2020-10-26 11:14:22 +01:00
# gh auth
> Authenticate with a GitHub host.
2020-10-26 11:14:22 +01:00
> More information: <https://cli.github.com/manual/gh_auth>.
- Log in with interactive prompt:
2020-10-26 11:14:22 +01:00
`gh auth login`
- Log in with a token from `stdin` (created in <https://github.com/settings/tokens>):
2020-10-26 11:14:22 +01:00
`echo {{your_token}} | gh auth login --with-token`
- Check if you are logged in:
`gh auth status`
- Log out:
`gh auth logout`
- Log in with a specific GitHub Enterprise Server:
2020-10-26 11:14:22 +01:00
`gh auth login --hostname {{github.example.com}}`
2021-02-24 10:11:22 -03:00
- Refresh the session to ensure authentication credentials have the correct minimum scopes (removes additional scopes requested previously):
`gh auth refresh`
- Expand the permission scopes:
`gh auth refresh --scopes {{repo,admin:repo_hook,admin:org,admin:public_key,admin:org_hook,...}}`