commit 3e8c61bf56fd4d45a5f7b5350a5d4a1d796ef422
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2022-08-14T14:54:35Z |
| subject | Added git-amend-author |
commit 3e8c61bf56fd4d45a5f7b5350a5d4a1d796ef422
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2022-08-14T14:54:35Z
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"