An Oh My Zsh plugin for GPG encrypted, Internet synchronized Zsh history using Git.
sudo apt install gpg git
git clone [email protected]:wulfgarpro/history-sync.git
cp -r history-sync ~/.oh-my-zsh/plugins
Then open .zshrc file and append history-sync to the plugin line:
plugins=(... history-sync)
And finally, reload zsh:
zsh
Before history-sync can be useful, you need two things:
Once you have these things in place, it's just a matter of updating the needed environment variables to suit your configuration:
Which have the following defaults:
ZSH_HISTORY_FILE_NAME=".zsh_history"
ZSH_HISTORY_FILE="${HOME}/${ZSH_HISTORY_FILE_NAME}"
ZSH_HISTORY_PROJ="${HOME}/.zsh_history_proj"
ZSH_HISTORY_FILE_ENC_NAME="zsh_history"
ZSH_HISTORY_FILE_ENC="${ZSH_HISTORY_PROJ}/${ZSH_HISTORY_FILE_ENC_NAME}"
ZSH_HISTORY_COMMIT_MSG="latest $(date)"
and running the commands:
# pull history
zhpl
# push history
zhps -r "John Brown" -r 876T3F78 -r ...
# pull and push history
zhsync
Check out the screen cast.
MIT @ James Fraser