-
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.gitgit init --bare --initial-branch=master
- note: may output, 'fatal: This operation must be done in a work tree' ignore this.
- visit the
.password-storedirectory and set.password-serve.gitas 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-daemonis required for mDNS resolution as well asdbusfor 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/hooksand setup apost-updatehook 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.gitrepository 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-storedirectory to the new server made.
pass git push -u origin master