Skip to content

Instantly share code, notes, and snippets.

@Illizian
Last active May 26, 2017
Embed
What would you like to do?
A QoL ZSH/Bash script for Trezor related git activities
git() {
if command git rev-parse --git-dir > /dev/null 2>&1; then
# We're in a Git Repo
identity=$(command git config remote.origin.url | egrep -o '[a-z]+@[a-z]+.[a-z]+')
case "$1" in
commit)
command trezor-gpg unlock
command git $@
;;
clone|push|pull)
command trezor-agent $identity -- git $@
;;
*)
command git $@
esac
else
command git $@
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment