[英]GIT: fatal: Could not read from remote repository when you create new branch
我正在創建新分支,並嘗試推送分支(我嘗試了以下命令):
git push --all -u
git push origin NewBranch
但是在兩種情況下,我都會收到此錯誤:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
這是我的.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
這是起源:
origin ssh://git@github.com/myName/myRepo.git (fetch)
origin ssh://git@github.com/myName/myRepo.git (push)
你們誰都知道為什么會出現此錯誤?
非常感謝您的幫助
再檢查一遍:
myName/myRepo.git
的確切大小寫(大寫/小寫) 如果問題仍然存在,並帶有https網址
git remote set-url origin https://github.com/myName/myRepo.git
不確定OP是否解決了他的問題,但是對於將來的參考(因為這不久前對我有所幫助哈哈),問題在於SSH / OAuth授權。 我通過替換OAuth進行終端訪問並更新gitconfig文件解決了我的情況:
** OSX Sierra平台**
git config -e
命令檢查您的配置文件。 Git在github上有大量的文檔記錄,因此,如果遇到麻煩,只需在其上進行快速搜索即可(或stackoverflow ...),希望它不會太難清除。 人們樂於助人,所以不要害怕問一個愚蠢的問題!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.