当前位置:   article > 正文

git命令中clone项目_git克隆

git克隆

一、方法一

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

1.输入语句

git clone 链接

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

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

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

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

二、第二种方法

1. ssh方法(成功了)

输入语句

git clone git@地址

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

  1. Cloning into 'vue_1'...
  2. The authenticity of host 'gitcode.net (119.3.229.170)' can't be established.
  3. RSA key fingerprint is SHA256:pyrMa3p0o90Qsuz2+kMX3CIBl+S1cZsdRlCoaosSgQs.
  4. Are you sure you want to continue connecting (yes/no)? yes
  5. Warning: Permanently added 'gitcode.net,119.3.229.170' (RSA) to the list of known hosts.
  6. git@gitcode.net: Permission denied (publickey).
  7. fatal: Could not read from remote repository.
  8. Please make sure you have the correct access rights
  9. and the repository exists.

3.生成公钥

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

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

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

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

4.配置公钥

 注意:有效期的设置时间

5.输入

证明成功!!! 

6.输入,回车即可

git clone git@项目链接地址

 

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

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/465937
推荐阅读
相关标签
  

闽ICP备14008679号