From 3e8c61bf56fd4d45a5f7b5350a5d4a1d796ef422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Sun, 14 Aug 2022 22:54:35 +0800 Subject: [PATCH] Added git-amend-author --- bash/bashrc/sources/31_git-utils | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bash/bashrc/sources/31_git-utils b/bash/bashrc/sources/31_git-utils index 0a7719d..a06cae0 100644 --- a/bash/bashrc/sources/31_git-utils +++ b/bash/bashrc/sources/31_git-utils @@ -14,6 +14,13 @@ function git-config-as { echo "Configured as \"$NAME <$EMAIL>\"" } +function git-amend-author { + NAME=$( git config user.name ) + EMAIL=$( git config user.email ) + + git commit --amend --no-edit --author "$NAME <$EMAIL>" +} + if [ ! -f "$HOME/.gitconfig" ]; then cat << ___CONF___ > "$HOME/.gitconfig"