我第一次使用git,并设置了用户名和用户邮件。我使用的命令如下:
git config --global user.email "[email protected]"
git config user.email "[email protected]"
git config --global user.name "bob"
git config user.name "bob"
我跑步git commit --author "bob"
时遇到错误fatal: No existing author found with 'bob'
。如何设置用户名和电子邮件?
您应该在--author
每次提交时停止使用,而是使用来配置作者git config
。完成此操作后,您可以输入内容git commit
,作者将从您的.gitconfig
文件中拉出。
如果要提供--author
用于编写提交的名称,则需要使用
bob <[email protected]>
不只是bob
。如果您的作者字符串与user <[email protected]>
格式不匹配,则Git会假定您已为其提供了搜索模式,它将尝试查找具有匹配作者的提交。它将使用找到的第一个提交user <[email protected]>
作为作者。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句