git 使用过程中遇到的问题does not appear to be a git repository Could not read from remote respository

想把本地的git库上传到github上。github已经新建了一个public仓库,利用网站的命令

git Bash报错:does not appear to be a git repository  Could not read from remote respository

    

网上搜索了一下,说是github的公钥没有生成,但是网上搜索到的方法不能解决我的问题,去官网自己看,有生成公钥的方法

链接:https://help.github.com/en/articles/connecting-to-github-with-ssh 照着文档操作就可以了

1、检查是否存在SSH key:

$ ls -al ~/.ssh

类型如下:pub是公钥。

  • id_dsa.pub
  • id_ecdsa.pub
  • id_ed25519.pub
  • id_rsa.pub

2、Generating a new SSH key :email是你注册github的邮箱

$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

3、出现下面信息时,回车就好:

Enter a file in which to save the key (/c/Users/you/.ssh/id_rsa):[Press enter]

4、重新打开git Bash

再次检查SSH key

5、cat id_rsa.pub 打开秘钥文档复制里面的公钥添加到 setting-SSH and GPG keys-new SSH key里 重新登录github就好

原文地址:https://www.cnblogs.com/t-ae/p/10730755.html