一、问题

在vercel部署nextjs项目时,报错A commit author is required,如图所示:

github的部署也报错:No GitHub account was found matching the commit author email address

二、原因

提交commit时候的邮箱未绑定到github中去。

三、解决方案

解决方案有两种:

  1. 修改commit的邮箱为已经绑定到github的邮箱
  2. 在github上绑定commit的邮箱

受限通过git log命令查看当前commit的邮箱:

Author列会展示当前提交的用户及邮箱,将邮箱登记到githb中去(位于Settings - Emails - Add email address):

或者通过命令修改git的用户和邮箱,邮箱要和github中绑定的一致:

git config --global user.name "username"
git config --global user.email "username@email.com"

然后就可以正常部署了:

四、参考

Adding an email address to your GitHub account

最后修改:2025 年 03 月 12 日
喜欢就给我点赞吧