动态更改 Git 用户
我希望能够在 git 中切换名称和电子邮件,我尝试了以下操作:
alias setup_diffuser='export GIT_COMMITTER_NAME="Blah" && export GIT_COMMITTER_EMAIL="[email protected]" && export GIT_AUTHOR_NAME="Blah" && GIT_AUTHOR_EMAIL="[email protected]" && export BLAH="true"'
但是 git 提交中的名称是正确的,但电子邮件是 ~/.gitconfig
中的电子邮件而不是电子邮件在$GIT_AUTHOR_EMAIL
中,如何在不编辑~/.gitconfig
的情况下像上面那样动态设置电子邮件?我正在运行 git 版本 1.7.3.4
I'd like to be able to switch the name and email in git, I tried this:
alias setup_diffuser='export GIT_COMMITTER_NAME="Blah" && export GIT_COMMITTER_EMAIL="[email protected]" && export GIT_AUTHOR_NAME="Blah" && GIT_AUTHOR_EMAIL="[email protected]" && export BLAH="true"'
but the name in the git commit is correct but the email is the one in ~/.gitconfig
not the email in$GIT_AUTHOR_EMAIL
How can I set the email on the fly like above without editing the ~/.gitconfig
? I'm running git version 1.7.3.4
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您忘记了
GIT_AUTHOR_EMAIL
的导出:You forgot an export for
GIT_AUTHOR_EMAIL
: