From 47dd82bab03edf30f013ae3c7da1839a408bea46 Mon Sep 17 00:00:00 2001 From: desktop Date: Thu, 12 Oct 2023 13:06:34 +0300 Subject: [PATCH] bash : add gu for specifying git user. --- document/linux/config/bash/module/git.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/document/linux/config/bash/module/git.sh b/document/linux/config/bash/module/git.sh index 42d10ce..bd9aaf1 100644 --- a/document/linux/config/bash/module/git.sh +++ b/document/linux/config/bash/module/git.sh @@ -45,3 +45,19 @@ gr() git rebase -i HEAD~${base} fi } + +# specify git user. +# usage: gu [NAME] [EMAIL] +gu() +{ + local name="${1}" + local email="${2}" + + if [[ "${name}" = "" || "${email}" = "" ]]; then + echo "usage: gu [NAME] [EMAIL]" + return 1 + fi + + git config user.name "${name}" + git config user.email "${email}" +}