git命令中clone项目

一、方法一

1.https方式(以失败告终)

1.输入语句

git clone 链接

出现如下界面,需要账号密码,密码我不知道是什么,随便输入后出现如下错误(大体意思就是身份校验失败)

Cloning into 'vue_1'...
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://gitcode.net/weinipeizhen/vue/vue_1.git/'

 2.找到控制面板,------>用户账户------>凭据管理器------->管理windows凭据,找到刚才账号密码,进行删除;

        删除之后,继续执行clone语句,重新输入账号密码(由于我不知道账号密码,试了多次未成功)

二、第二种方法

1. ssh方法(成功了)

输入语句

git clone git@地址

2.会出现错误(大体意思就是没有生成公钥,权限被拒绝)

Cloning into 'vue_1'...
The authenticity of host 'gitcode.net (119.3.229.170)' can't be established.
RSA key fingerprint is SHA256:pyrMa3p0o90Qsuz2+kMX3CIBl+S1cZsdRlCoaosSgQs.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitcode.net,119.3.229.170' (RSA) to the list of known hosts.
git@gitcode.net: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

3.生成公钥

ssh-keygen -t ed25519 -C "xxx@xxx.com"
之后按三次回车即可

注意:“xxx@xxx.com”并不是邮箱名称,而是生成 sshkey的名称

cat ~/.ssh/id_ed25519.pub  ------生成公钥

cat ~/.ssh/id_ed25519    ---------生成密钥

4.配置公钥

 注意:有效期的设置时间

5.输入

证明成功!!! 

6.输入,回车即可

git clone git@项目链接地址

 

到这里项目便可以clone完毕了!!!

7.我第一次设置的有效时间不足24小时(看不懂英文意思),clone之后会有提示

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值