可以通过以下命令为本地 Git 仓库设置用户名和邮箱地址:
git config --local user.name "your_username_here"
git config --local user.email "your_email_here"
其中,--local
参数表示只为当前的本地仓库设置用户名和邮箱地址。如果想要为全局 Git 配置设置用户名和邮箱地址,可以使用 --global
参数,如下所示:
git config --global user.name "your_username_here"
git config --global user.email "your_email_here"
在上述命令中,需要将 "your_username_here"
替换为你的 GitHub 用户名,将 "your_email_here"
替换为你的 GitHub 邮箱地址。设置完成后,Git 就可以正确地将你的提交归属到你的 GitHub 帐户。