我尝试这样提交
git commit --author='Paul Draper <my@email.org>' -m 'My commit message'
但我明白了
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
我可以设置它们,但是我在一个共享的盒子上,之后我将不得不(想要)取消它们。
git config user.name 'Paul Draper'
git config user.email 'my@email.org'
git commit -m 'My commit message'
git config --unset user.name
git config --unset user.email
一次提交有很多行!
有更短的方法吗?
GIT_COMMITTER_NAME和GIT_COMMITTER_EMAIL(以及AUTHOR相同的版本,或者--author像您一样使用参数),就足够了,并且不需要--unset。