Skip to content

Get

Read a credential request from standard input and write the resolved credential to standard output in the git credential protocol format.

git invokes this operation itself after the helper is configured. The response is the only thing written to standard output; diagnostics go to standard error so a failure never corrupts the protocol stream.

Usage

git-credential-oauth get

Examples

Run the helper directly, with diagnostics on standard error.

printf 'protocol=https\nhost=github.com\n\n' | git-credential-oauth --verbose get

Use the device grant instead of a browser.

printf 'protocol=https\nhost=github.com\n\n' | git-credential-oauth --device get

Global Options

FlagShortDefaultTypeDescription
--bearerfalseboolreturn a Bearer credential on hosts that accept one (Git 2.46 or later)
--devicefalsebooluse the device authorization grant instead of a browser
--verbose-vfalseboollog debug information to stderr