Skip to content

Commit 54f5431

Browse files
committed
Added configuration of gpg indentity
1 parent 585a739 commit 54f5431

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.git-clone-init

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

33
case "$url" in
4-
*@github.com:* ) email=""; name="";;
5-
*//github.com/* ) email=""; name="";;
4+
*@github.com:* ) email=""; name=""; gpgid="";;
5+
*//github.com/* ) email=""; name=""; gpgid="";;
66
esac

post-checkout

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ cat << INPUT > ~/.git-clone-init
3333
#!/bin/bash
3434
3535
case "\$url" in
36-
*@github.com:* ) email=""; name="";;
37-
*//github.com/* ) email=""; name="";;
36+
*@github.com:* ) email=""; name=""; gpgid="";;
37+
*//github.com/* ) email=""; name=""; gpgid="";;
3838
esac
3939
INPUT
4040
warn "\nMissing file ~/.git-clone-init. Template created..."
@@ -51,3 +51,10 @@ git config --local user.email "$email"
5151
git config --local user.name "$name"
5252

5353
echo -e "\nLocal identity for ${PWD##*/} set to \"$name <$email>\""
54+
55+
if [[ ! -z $gpgid ]]; then
56+
git config commit.gpgsign true
57+
git config user.signingkey $gpgid
58+
59+
echo -e "\n Repo configured to use $gpgid GPG Identity"
60+
fi

0 commit comments

Comments
 (0)