zoukankan      html  css  js  c++  java
  • 在操作Git Bash时出现的问题

    参考博客:https://blog.csdn.net/weixin_44394753/article/details/91410463

    1、问题1

    $ git remote add origin git@github.com:xusongxu/learngit.git

    报错:

    fatal: remote origin already exists.//致命:远程来源已经存在远程库

    解决问题1:第一步:$ git remote rm origin      第二步正常添加:$ git remote add origin git@github.com:xusongxu/learngit.git

     2、问题2

    $ git push -u origin master

    报错:
    git@github.com: Permission denied (publickey).

    git@github.com:权限被拒绝(公钥)

    fatal: Could not read from remote repository.

     
    致命:无法从远程存储库中读取

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

    请确保您拥有正确的访问权限 并且存储库存在

    解决问题2:

    第一步:在GitHub主页上创建一个新的密钥"New SSH key":

    在Git Bash输入:

    $ ssh-keygen -t rsa -C "1559464600@qq.com"

    $ cat ~/.ssh/id_rsa.pub

    将得到的SSH KEY复制到GitHub的SSH KEY上。

     $ git push --set-upstream origin master

    如果再次出现fatal: remote origin already exists.//致命:远程来源已经存在远程库

    第一步:$ git remote rm origin      第二步正常添加:$ git remote add origin git@github.com:xusongxu/learngit.git

    业精于勤而荒于嬉,勤劳一日,可得一日安眠;勤劳一生,可得幸福一生。因为,我们努力了;因为,天道酬勤。
  • 相关阅读:
    git学习笔记
    angular自定义指令-1
    转 三范式
    CentOS 7 安装NVIDIA驱动实现修改分辨率和扩屏功能
    acm 2034
    acm 2031
    记票统计
    acm 2020 map 逆向输出
    acm 2014
    将输入的字符一个一个读入
  • 原文地址:https://www.cnblogs.com/Mr-choa/p/12565003.html
Copyright © 2011-2022 走看看