Skip to content

Instantly share code, notes, and snippets.

@clly
Created March 14, 2022 17:20
Show Gist options
  • Save clly/9e014d10e6786047a861c76a572fbd56 to your computer and use it in GitHub Desktop.
Save clly/9e014d10e6786047a861c76a572fbd56 to your computer and use it in GitHub Desktop.
Managing and retrieving credentials using git-credential-manager
# Retrieving credentials
(echo protocol=https; echo url=https://clly@github.com; echo host=github.com) | git-credential-manager-core get
# OR
(echo url=https://clly@github.com) | git credential fill
## To replace credentials use the INPUT/OUTPUT format in git-credentials[1]: https://git-scm.com/docs/git-credential#IOFMT
cat <<EOF | git-credential-manager-core store
protocol=https
host=github.com
username=foobar
password=hunter12 # (this should be a Personal Access Token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment