coding新建项目和仓库创建ssh公钥方法github访问clone和Authentication failed

本文指导如何在Coding平台创建代码仓库,通过SSH克隆到GitHubDesktop,并处理SSH公钥设置以实现顺利同步。步骤包括在Coding上创建仓库,复制SSH地址,配置本地Git,生成SSH密钥对,将公钥添加到Coding账户,以及解决可能的认证失败问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

登录coding管理界面:
1 左上角切换到项目(如果没有的话,创建之)
2 点击左侧菜单‘代码仓库’
3 点击右上角的‘创建代码仓库’
4 创建完成后,回到‘代码仓库’界面,进入该仓库。
5 点击右上角‘克隆下载’,复制‘ssh’选项卡下面的内容
6 切换到电脑端github destkop界面
7 左上角选择add-》clone respoitry-》在弹出界面粘贴刚才的git地址
8 点击clone,如果没成功报错的话,则继续下面的操作:

进入cmd命令行(我这里是win7上docker操作的)
1. 进入命令行 cd ~/.ssh 查询.ssh文件,如果没有的话创建,输入 mkdir ~/.ssh

再输入 git config --global user.name 'lumeng'  
再输入 git config --global user.email '946@qq.com'
再输入 ssh-keygen -t rsa -C '946@qq.com' 
这时生成了公钥文件,会多出2个文件:
id_rsa.pub和id_rsa

2. 查询id_rsa.pub,查询:
cat id_rsa.pub即可
然后全部复制

3 登录coding管理界面
4 点击左下角‘姓名’-》个人账户设置-》SSH公钥-》新增公钥
5 粘贴公钥内容,确认。

Authentication failed. Some common reasons include:

- You are not logged in to your account: see File > Options.
- You may need to log out and log back in to refresh your token.
- You do not have permission to access this repository.
- The repository is archived on GitHub. Check the repository settings to confirm you are still permitted to push commits.
- If you use SSH authentication, check that your key is added to the ssh-agent and associated with your account.
- If you use SSH authentication, ensure the host key verification passes for your repository hosting service.
- If you used username / password authentication, you might need to use a Personal Access Token instead of your account password. Check the documentation of your repository hosting service.

Would you like to retry cloning ?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值