git push 错误

错误提示

Logon failed, use ctrl+c to cancel basic credential prompt.
Username for 'https://github.com': koringz
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 

1. 生成 SSH 密钥:在终端中运行以下命令生成密钥(一路回车即可)

ssh-keygen -t ed25519 -C "your_email@example.com"

2.复制公钥:查看并复制生成的公钥内容:

cat ~/.ssh/id_ed25519.pub

3.添加到代码平台:登录你的代码托管平台,进入 Settings -> SSH and GPG keys -> New SSH key,将刚才复制的公钥粘贴进去并保存12

4.修改远程仓库地址为 SSH 格式:将当前的 HTTPS 地址替换为 SSH 地址:

git remote set-url origin git@github.com:你的用户名/你的仓库名.git

5.测试连接并推送: 弹出框输入 git

ssh -T git@github.com
git push origin 1.0.
```<websource>source_group_web_4</websource>

 

posted @ 2026-08-09 23:20  微宇宙  阅读(4)  评论(0)    收藏  举报