致命的:没有现有的作者发现'XXX' [英] fatal: No existing author found with 'XXX'

查看:221
本文介绍了致命的:没有现有的作者发现'XXX'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次使用git,并设置了我的用户名和用户邮件。我使用的命令如下:

  git config --global user.emailbob@example.com
git config user.emailbob@example.com
git config --global user.namebob
git config user.namebob

当我运行 git commit --authorbob时,出现错误致命:没有找到'bob'的现有作者。如何设置用户名和电子邮件地址?

c $ c>>,而是使用 git config 来配置作者。一旦你这样做了,你可以输入 git commit ,作者将从你的 .gitconfig 文件中被提取。

如果您想给 - author 一个用于创作提交的名称,您需要使用



bob< bob@example.com>



不只是 bob 。如果您的作者字符串不符合用户< user@example.com> 格式,Git会假设您已为其提供搜索模式,并且会尝试查找提交匹配的作者。它将使用第一个找到的提交的 user< user@example.com> 作为作者。


I used git for the first time and I set my user name and user mail. The commands I used are below:

git config --global user.email "bob@example.com"
git config user.email "bob@example.com"
git config --global user.name "bob"
git config user.name "bob"

When I run git commit --author "bob" , I got an error fatal: No existing author found with 'bob'. How can I set user name and email?

解决方案

You should stop using --author each time you commit, and instead configure an author with git config. Once you've done so, you can type git commit and the author will be pulled from your .gitconfig file.

If you want to give --author a name to use for authoring the commit, you need to use

bob <bob@example.com>

not just bob. If your author string doesn't match the user <user@example.com> format, Git assumes you've given it a search pattern, and it will try to find commits with matching authors. It will use the first found commit's user <user@example.com> as the author.

这篇关于致命的:没有现有的作者发现'XXX'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆