zoukankan      html  css  js  c++  java
  • git clone问题

    中秋节回来上班 竟然忘记带电脑了  ̄□ ̄||还好同事有备用电脑,这要是回去拿估计上午都不用干什么了,用同事电脑当然需要安装环境,下面说一下git上遇到的问题吧

    (1)首先我尝试用https方式克隆代码,但是遇到如下错误

    remote: HTTP Basic: Access denied fatal: Authentication failed for。。。

    经过一番搜索大体意思是:

    git config --system --unset credential.helper

    然后再更新用户名 邮箱 密码等,但是网上说的这些我这都不好用(如果哪位大神指导请指教)

    经过再次搜索发现如下方法解决了https方式克隆代码的问题:

    git clone http://账号:密码@git.xx.xx.com.cn/xx/xx.git 

    (2)我又尝试了一下ssh方式克隆代码

    首先查看是否有生成ssh

    $ cd ~/.ssh
    $ ls
    authorized_keys2  id_dsa       known_hosts config            id_dsa.pub  

    发现已经生成过ssh,如果想用自己的git邮箱生成ssh key会提示覆盖,直接覆盖即可当然也可以删除掉已有的.ssh文件

    $ ssh-keygen -t rsa -C "your_email@youremail.com"
    
    Creates a new ssh key using the provided email # Generating public/private rsa key pair.
    
    Enter file in which to save the key (/home/you/.ssh/id_rsa):
    

    按照提示操作即可,查看公钥

    cat ~/.ssh/id_rsa.pub
    

     然后把key直接粘贴到git上即可

  • 相关阅读:
    140704
    140703
    140702
    堆排序
    并查集
    140701
    这年暑假集训-140630
    vim for python
    hihocode 第九十二周 数论一·Miller-Rabin质数测试
    hdu 3157 Crazy Circuits 有源汇和下界的最小费用流
  • 原文地址:https://www.cnblogs.com/hongsusu/p/9700404.html
Copyright © 2011-2022 走看看