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,将刚才复制的公钥粘贴进去并保存
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>
如需转载原创文章,请标注原文地址,版权所有!
浙公网安备 33010602011771号