Skip to content

Instantly share code, notes, and snippets.

@Illizian
Last active May 26, 2017 06:14
Show Gist options
  • Save Illizian/2da4bb70288956d153da3e84f3292ca4 to your computer and use it in GitHub Desktop.
Save Illizian/2da4bb70288956d153da3e84f3292ca4 to your computer and use it in GitHub Desktop.
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