Skip to content

Instantly share code, notes, and snippets.

@333fred
Created July 7, 2017 22:52
Show Gist options
  • Save 333fred/21f641680531272fbdd7a6b84b788281 to your computer and use it in GitHub Desktop.
Save 333fred/21f641680531272fbdd7a6b84b788281 to your computer and use it in GitHub Desktop.
Git For Windows on WSL With GPG2 Signing
# ZSH Function to determine what version of git to run, based on a list of known windows locations. Source from .zshrc
win_locs=('/mnt/c' ...) # Others go here
select_git() {
local cur_dir=$(pwd)
local win_git='/mnt/c/Program Files/Git/bin/git.exe'
for loc in $win_locs; do
if [[ $cur_dir == $loc* ]] then
$win_git "$@"
return $?
fi
done
/usr/bin/git "$@"
return $?
}
alias git='select_git'
# Goes where GNUPGHOME is set to. On my machines, usually %APPDATA%\gnupg. Base options copied from the default gpg.config, license for that file follows.
# Options for GnuPG
# Copyright 1998, 1999, 2000, 2001, 2002, 2003,
# 2010 Free Software Foundation, Inc.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
no-greeting
batch
use-agent
charset utf-8
keyserver hkp://keys.gnupg.net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment