set user.name and user.email while committing message

This commit is contained in:
hophacker 2019-12-18 14:00:20 +08:00
parent a24fbae64d
commit 4df8e567eb
2 changed files with 4 additions and 0 deletions

View File

@ -3,7 +3,9 @@
:bulk_threshold: 1000
:sources:
- https://gems.ruby-china.com
- https://rubygems.org/
:update_sources: true
:verbose: true
:concurrent_downloads: 8
benchmark: false
gem: "--no-document"

View File

@ -388,6 +388,8 @@ function gc {
echo 'invalid option...'
done
emails=($GIT_EMAILS)
git config user.name $name
git config user.email $emails[$index]
(git commit --verbose $*) || return
(git commit --amend --author="$name <$emails[$index]>") || return
}