Skip to content

Git credentials helpers

Cache daemon running in background:

git credential-cache--daemon /home/varac/.cache/git/credential/socket

git-credential-oauth

Install:

pamac install git-credential-oauth

Configure:

git config --global --unset-all credential.helper
git config --global --add credential.helper "cache --timeout 21600" # six hours
git config --global --add credential.helper oauth

Custom Gitlab host

export GITLAB_URL=https://0xacab.org
git config --global credential.${GITLAB_URL}.oauthClientId $(gopass show --password mnt/ndr/token/0xacab.org/varac/application/git-credential-oauth/id
git config --global credential.${GITLAB_URL}.oauthScopes read_repository write_repository
git config --global credential.${GITLAB_URL}.oauthAuthURL /oauth/authorize
git config --global credential.${GITLAB_URL}.oauthTokenURL /oauth/token

Test/Debug

export GIT_TRACE=1
echo url=https://gitlab.com | git credential fill

Configure custom Gitlab hosts

Custom GitLab instance support

git-credential-manager

Gopasspw git-credential-gopass

Install:

pamac install git-credential-gopass
git help -a | grep gopass

Setup:

git config --global credential.helper gopass

Setup for specific store/mount:

git config --global credential.helper "gopass --store=work"