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/'

git命令中clone项目_第1张图片git命令中clone项目_第2张图片

 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.
[email protected]: 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 "[email protected]"
之后按三次回车即可

注意:“[email protected]”并不是邮箱名称,而是生成 sshkey的名称

git命令中clone项目_第3张图片

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

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

4.配置公钥

git命令中clone项目_第4张图片

 注意:有效期的设置时间

5.输入

证明成功!!! 

6.输入,回车即可

git clone git@项目链接地址

git命令中clone项目_第5张图片

 

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

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

git命令中clone项目_第6张图片

你可能感兴趣的:(gitee,gitCode,git,github)