-
create bare git repo to push and pull from all devices.
mkdir ~/.config/.password-serve.git
-
initialise the empty bare git repository
cd ~/.config/.password-serve.git
git init --bare --initial-branch=master
- note: may output, 'fatal: This operation must be done in a work tree' ignore this.
- visit the
.password-store
directory and set.password-serve.git
as remote.
- server machine:
pass git remote add origin ~/.config/.password-serve.git
- client machine:
pass git remote add origin ssh://[email protected]/<absolute path to password-serve.git
- note:
avahi-daemon
is required for mDNS resolution as well asdbus
for concurrency and SSH
-
setup merge options on both machines to fast-forward only, using the rebase model to avoid conflicts.
pass git config --local --add branch.master.mergeoptions --ff-only
-
visit
.password-serve.git/hooks
and setup apost-update
hook with the following contents.
- this is an automatic pull to the origin password-store if the repository is hosted in the same device as one of the clients of the server.
- if the
password-serve.git
repository is not on the same device, then automatic pulling from any changes made is should be done manually.
touch post-update
chmod +x post-update
#!/bin/sh
echo
echo "*** pulling changes into password store ***"
echo
cd ~/.config/.password-store/ || exit
unset GIT_DIR
git pull origin master
exec git-update-server-info
- finally push all the contents of your
password-store
directory to the new server made.
pass git push -u origin master