[pass] Using pass with git config core.askpass

James Cameron quozl at laptop.org
Tue Nov 18 22:55:22 CET 2014


On Tue, Nov 18, 2014 at 10:41:00PM +0100, Alexander Baier wrote:
> I would like to use pass to supply git with login information when
> accessing a remote repository (e.g. on github).  I put the following
> section into my ~/.gitconfig:
> 
> [core]
>     askpass = pass show Code/github.com
> 
> Doing 'git push' will now print
> 
>   "error: cannot run 'pass show Code/github.com': No such file or
>   directory"

My guess is that askpass requires a single path, so make a script that
contains what you need:

% cat >>github-askpass <<EOF
#!/bin/sh
exec pass show Code/github.com
EOF
% chmod +x github-askpass

And then in .gitconfig

[core]
    askpass = /path/to/github-askpass

-- 
James Cameron
http://quozl.linux.org.au/


More information about the Password-Store mailing list