2017-04-05 52 views
0

是否有可能在没有全局设置的user.email/use.name的情况下执行git merge?加入--author 'Your Name <email>'Git合并时没有全局设置用户名

git commit -m 'my_funny_commit_comment' --author 'Your Name <email>'

回答

0

*** Please tell me who you are. 

Run 

    git config --global user.email "[email protected]" 
    git config --global user.name "Your Name" 

to set your account's default identity. 
Omit --global to set the identity only in this repository. 

fatal: empty ident <email> not allowed 

git commit情况下,可以简单地执行一个承诺,而全球的用户名/电子邮件:

我得到以下致命错误,导致合并如果您不想全局设置电子邮件地址,您只能设置电子邮件和密码 -

git config user.name "Your Name" 
git config user.email "[email protected]" 

虽然上面推荐的方法,您可以用git commit

git -c "user.name=Your Name" -c "[email protected]" commit 
+0

传递的参数,我不喜欢的用户名进行任何存储在当前存储库。我希望它获得每个提交/合并的用户名。如果我可以以某种方式将它设置为仅用于当前会话(控制台),那就没有问题。 – r2d2oid

+0

尝试在控制台中设置“GIT_AUTHOR_NAME”和“GIT_AUTHOR_EMAIL”环境变量,并查看系统中是否为每会话。 –

+0

设置'GIT_AUTHOR_NAME'和'GIT_AUTHOR_EMAIL'没有帮助。 – r2d2oid