[英]GIT: fatal: Could not read from remote repository when you create new branch
I'm create new branch and I'm trying to push the branch (I have tried the following commands): 我正在创建新分支,并尝试推送分支(我尝试了以下命令):
git push --all -u
git push origin NewBranch
But in both cases I'm getting this error: 但是在两种情况下,我都会收到此错误:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
This is my .git/config: 这是我的.git / config:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = ssh://git@github.com/myName/myRepo.git
fetch = +refs/heads/*:refs/remotes/origin/*
pushurl = ssh://git@github.com/myName/myRepo.git
This is origin: 这是起源:
origin ssh://git@github.com/myName/myRepo.git (fetch)
origin ssh://git@github.com/myName/myRepo.git (push)
Any of you knows why of this error? 你们谁都知道为什么会出现此错误?
I'll really appreciate your help 非常感谢您的帮助
Double-check: 再检查一遍:
myName/myRepo.git
网址myName/myRepo.git
的确切大小写(大写/小写) if the issue persists with an https url 如果问题仍然存在,并带有https网址
git remote set-url origin https://github.com/myName/myRepo.git
Not sure if OP ever solved his issue or not, but for future references (since this helped myself not too long ago haha), the problem is with the SSH/OAuth authorization. 不确定OP是否解决了他的问题,但是对于将来的参考(因为这不久前对我有所帮助哈哈),问题在于SSH / OAuth授权。 I resolved my situation by replacing the OAuth for terminal access and updating my gitconfig file: 我通过替换OAuth进行终端访问并更新gitconfig文件解决了我的情况:
** OSX Sierra Platform ** ** OSX Sierra平台**
git config -e
command. 通过git config -e
命令检查您的配置文件。 Git is documented on github pretty extensively, so if you run into a hiccup, just give it a quick search on there (or stackoverflow ...) and hopefully it won't be too hard to clear up. Git在github上有大量的文档记录,因此,如果遇到麻烦,只需在其上进行快速搜索即可(或stackoverflow ...),希望它不会太难清除。 People are awesome at helping out, so don't be afraid to ask a dumb question! 人们乐于助人,所以不要害怕问一个愚蠢的问题!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.