A Simple git credential helper for pass
If the templating language is not powerful enough and you only want to read passwords from pass look at pass-git-helper
- Can store, get and erase passwords from pass
- Mostly uses .gitconfig for configuration
- Very simple template language
Install git-credential-pass from AUR ArchLinux wiki
Download the .deb file from the latest release and use dpkg -i file_you_just_downloaded.deb
to install it
~/.config/git-credential-pass/git.ldev.eu.org.template
{password}
login: {username}
~/.gitconfig
[credential]
helper = pass --pass-name "git/{protocol}/{host}" --template "~/.config/git-credential-pass/{host}.template"
NOTE Text between {} gets replaced by the value returned by git. See custom_helpers.
NOTE Use \ to escape characters \{ will be treated as a literal
~/.gitconfig
[credential]
helper = pass -p "git/{host}/{username}" --template "~/.config/git-credential-pass/{host}.template"
~/.gitconfig
[credential "https://git.ldev.eu.org"] # only use git-credential-pass for git.ldev.eu.org
useHttpPath = true
helper = pass -p "git/ldev" --template "~/.config/git-credential-pass/git.ldev.eu.org.template"
[credential] # use cache for everything else
helper=cache
~/.gitconfig
[credentials]
useHttpPath = true # this line is to make git send the path
# Store the credentials using the url path
helper = pass -p "git/{path}" --template "~/.config/git-credential-pass/template.template"