权限被拒绝(公钥).严重的:无法从远程存储库读取 [英] Permission denied (publickey). fatal: Could not read from remote repository

查看:191
本文介绍了权限被拒绝(公钥).严重的:无法从远程存储库读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的.git/config

  1 [core]
  2     repositoryformatversion = 0
  3     filemode = true
  4     bare = false
  5     logallrefupdates = true
  6 [remote "origin"]
  7     url = git@github.com:monajalal/instagram-scraper.git
  8     fetch = +refs/heads/*:refs/remotes/origin/*

当我尝试将更改推送到主服务器时,出现此错误:

When I am trying to push the changes to the master I get this error:

$ git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.

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

我都尝试过这两种方法,但仍然会出错:

I have tried these both but still get error:

2150  git remote set-url origin https://github.com/monajalal/instagram-scraper.git
 2154  git remote set-url origin git@github.com:monajalal/instagram-scraper.git


mona@pascal:~/computer_vision/instagram/instagram$ git log
commit e69644389a5c7be65ae6eae14d74065e221600cb
Author: Mona Jalal <jalal@cs.wisc.edu>
Date:   Wed Mar 1 17:48:00 2017 -0600

    scrapy for instagram skeleton
mona@pascal:~/computer_vision/instagram/instagram$ git status
On branch master
nothing to commit, working directory clean


$ uname -a ; lsb_release -a
Linux pascal 3.13.0-62-generic #102-Ubuntu SMP Tue Aug 11 14:29:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:    14.04
Codename:   trusty

请提出修复建议.

推荐答案

可能不是最好的解决方案,但考虑到我在github中创建的存储库中没有任何内容,我使用了以下命令,并且可以解决问题:

Possibly not the best solution but considering there was nothing in the repository I had created in github I used the following command and it worked out:

git push -f origin master

这篇关于权限被拒绝(公钥).严重的:无法从远程存储库读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆