社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Git

Git Commit在WSL2中请求凭据而不是SSH

Marco Gonçalves • 3 年前 • 1239 次点击  

其他一切似乎都可以使用SSH密钥,但当我这样做时:

git commit -m "message"

它给了我:

*** 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: empty ident name (for <COMPUTER_NAME>) not allowed

正如我所说的,除了提交之外,其他所有功能,git add、git push、git pull都按预期工作(git push/pull要求SSH身份验证)。

我已经查过了。git/config文件,以确保它是为SSH设置的,并且实际上是。

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/130141
 
1239 次点击  
文章 [ 1 ]  |  最新文章 3 年前
bk2204
Reply   •   1 楼
bk2204    3 年前

这不是提示输入凭据。在进行提交时,Git需要知道要嵌入到提交中的名称(即个人名称,而不是用户名)和电子邮件地址。这些数据与身份验证完全无关,只是Git创建提交所需的数据。一旦你提交了,你就可以用 git log .

您应该按照指示指定您的个人姓名和电子邮件地址,然后提交才能成功。