git - 使用 SSH 的 Git 提交请求电子邮件
问题描述
我正在尝试提交到我的 github 存储库,但我不断收到一条错误消息,要求我通过电子邮件和姓名登录来证明自己的身份。我使用 ssh 进行提交,我的 sshconfig 和密钥配置正确。我还检查了 gitconfig 文件,它们似乎也是正确的。有什么想法吗?
###Gitconfig file
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = git@github.com:imran1005/testhomere.git
fetch = +refs/heads/*:ref
[branch "master"]
remote = origin
merge = refs/heads/master
###Error msg on console win7 cmd while executing git commit:
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
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: unable to auto-detect email address (got 'TestUser@Asus.(none)')
解决方案
正如错误消息所述,您需要设置user.email
和user.name
git 配置。此信息存储在提交中,没有它们 git 将无法工作。
我的 sshconfig 和密钥配置正确
这无关紧要,当您将现有提交推送到某个远程时使用 ssh 密钥,而不是在创建新提交时使用。
推荐阅读
- azure-devops - ConnectWise <-> TFS 同步
- android-recyclerview - 无法让 recyclerview 加载元素
- vim - 如何创建一个重新排序行的 vim 宏?
- svg.js - SVG.JS - 如何在悬停时播放 + 暂停 SVG 动画?
- string - 尝试更改 sqlite 数据库中字段的部分值
- node.js - 无法卸载过时的、可能未使用的 NPM 包
- c# - EF Core - DB First 方法中不需要的属性
- java - 删除 Java 项目,然后在同一目录中创建相同的项目 - Eclipse
- sql - 查询多列不同条件的数据
- swift - 如何在 Xcode 11 中以编程方式创建 UI?