Skip to content

Instantly share code, notes, and snippets.

@fa0311
Last active April 30, 2024 09:57
Show Gist options
  • Save fa0311/58906a101b5963a690d9bad8bf62ad6d to your computer and use it in GitHub Desktop.
Save fa0311/58906a101b5963a690d9bad8bf62ad6d to your computer and use it in GitHub Desktop.
Gitconfig の Tips

署名

バグ

export GPG_TTY=$(tty) && echo "hoge" | gpg --clearsign

hook

使ってるやつ

.config\git\hooks\prepare-commit-msg

#!/bin/sh

NAME=$(git config user.name)
EMAIL=$(git config user.email)

if [ -z "$NAME" ]; then
    echo "empty git config user.name"
    exit 1
fi

if [ -z "$EMAIL" ]; then
    echo "empty git config user.email"
    exit 1
fi

git interpret-trailers --if-exists doNothing --trailer \
    "Signed-off-by: $NAME <$EMAIL>" \
    --in-place "$1"



GIT_ROOT=`git rev-parse --show-superproject-working-tree --show-toplevel | head -1`
HOOK_NAME=`basename $0`
LOCAL_HOOK="${GIT_ROOT}/.git/hooks/${HOOK_NAME}"

if [ -e $LOCAL_HOOK ]; then
  source $LOCAL_HOOK
fi
@fa0311
Copy link
Author

fa0311 commented Nov 1, 2023

scoop だとこう

[commit]
	gpgsign = true
[gpg]
	program = C:/Users/yuki/scoop/apps/gpg/current/bin/gpg.exe
[commit]
	gpgsign = true
[gpg]
	program = c:/Program Files (x86)/GnuPG/bin/gpg.exe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment