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

    业精于勤而荒于嬉,勤劳一日,可得一日安眠;勤劳一生,可得幸福一生。因为,我们努力了;因为,天道酬勤。
  • 相关阅读:
    MySQL中的事务
    MySQL中的锁
    MySQL查询更新所有满足条件的数据
    MySQL存储引擎
    MySQL架构
    MySQL中存储json格式数据
    Java反射破坏单例模式
    合唱队(华为OJ)
    Java实现生产者消费者问题
    Spring IOC + AOP 的实现
  • 原文地址:https://www.cnblogs.com/Mr-choa/p/12565003.html
Copyright © 2011-2022 走看看