Multiple Git subdirectories for different environments

Grégoire Détrez gregoire at
Thu Jan 12 13:38:28 CET 2017

Hi Todd,

On Wed, Jan 11, 2017 at 12:00:56PM -0500, Todd A. Jacobs wrote:
> I've been thinking about how pass currently implements Git, and wondering
> how one is intended to use subdirectories to divide up passwords. By
> default, pass doesn't really do any Git initializations; it seems to simply
> check whether PASSWORD_STORE_DIR is a Git directory.
> I see an option for PASSWORD_STORE_GIT, but there's no real example of how
> that's meant to be used. In addition, I suppose one could always use
> submodules or subtree merging to keep segments of the store separate, but
> again I don't see specific examples of how this is meant to be implemented
> effectively.
> What's the best practice if one wants to have separate sub-stores for
> different work environments, where only the relevant subdirectories are
> pulled in by Git?

I'm not completely sure I understand what you want to do but I think you
can achieve something like this using PASSWORD_STORE_GIT and

Assuming you have the following structure in your repository:
├── home
│   └── foo.gpg
└── work
    └── foo.gpg


    $ pass home/foo
    $ pass work/foo

Then you can do set the environment variables like this:

    $ export PASSWORD_STORE_GIT=~/.password-store
    $ export PASSWORD_STORE_DIR=~/.password-store/home
    $ pass foo
    $ export PASSWORD_STORE_DIR=~/.password-store/work
    $ pass foo

I hope it helps!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <>

More information about the Password-Store mailing list