1. 程式人生 > >fatal: Authentication failed could not read from remote repository

fatal: Authentication failed could not read from remote repository

Git 無法clone、pull、fetch

異常:

fatal: could not read from remote repository
fatal: Authentication failed for 'http://git.example.com/example/master.git/'

所在公司使用Git版本管理工具,由於以前用的都是SVN,所以不是很熟悉,公司用一個Git賬號,個人有一個GitHub賬號,我就想配置兩套賬號,然後就出現了上面的異常。

出現異常之前

配置好了Git的SSH,相應的地方添加了Key。
Git Bash處於當前Git目錄下

ssh-keygen -t
rsa -C[email protected]163.com”

然後找到C:\Users\Administrator.ssh\id_rsa.pub,將裡面的Key新增到Git SSH Key中,然後我發現使用的時候還是需要輸入賬號密碼(因為我之前用Eclipse通過http下載的原始碼),也沒有深究為什麼還要輸入賬號和密碼。

配置多Git賬號

1.生成SSH,及上面的命令,注意”id_rsa.pub”這個是預設名,記得改。我的是 “id_rsa_github.pub”
2.新增自己的config檔案,在同一目錄下

Host github.com
    HostName github.com
User xukai IdentityFile ~/.ssh/id_rsa_github Host git.example.com HostName git.example.com User xukai1 IdentityFile ~/.ssh/id_rsa

3.切換到SSH協議
GitHub的Repository我是在本地電腦通過GitHub Desktop建立的。走的也是http協議,修改為SSH

git remote -v   //檢視詳細
git remote set-url origin https://github.com/USERNAME/REPOSITORY_2.git
ssh -T [email protected].com

最後一行是測試SSH是否配置成功,成功會顯示username。

出現異常

通過上面的GitHub測試,我打算把公司賬號Git的問題解決一下,將協議切換到SSH,然後pull,就出現了標題上的問題,開始以為是因為我配置了兩個賬號的問題,然後把兩個賬號的配置檔案ctrl+x,backup。
從頭來過,重新配置SSH,生成Key,新增Key,pull,不行,clone,不行;
重啟電腦
從頭來過,重新配置SSH,生成Key,新增Key,pull,不行,clone,不行。崩潰了~
測試了一下

ssh -T [email protected].example.com

我的賬號顯示Welcome,SSH配置是對的!
使用GitHub Desktop進行clone,pull都沒問題,於是我懷疑了Git Bash了。

解決

原因是因為Git for Windows這個軟體的Bug。Cannot pull/fetch/clone/push with Git for Windows 2.14 over SSH
升級軟體就好了。

git --version   // 檢視當前Git Bash版本

相關推薦

fatal: Authentication failed could not read from remote repository

Git 無法clone、pull、fetch 異常: fatal: could not read from remote repository fatal: Authentication failed for 'http://git.example.com/

git clone failed. Could not read from remote repository

問題:   在使用git克隆gitee或者github上面的專案時,能夠連線上卻無法下載下來! 解決:        1、在本地開啟git bash 執行            檢查是否有設定賬戶名

windows下Idea使用git clone failed. Could not read from remote repository

剛入職新公司,等了好幾天,今天公司給發了新電腦,就要開始進行開發環境的安裝了。 在軟體(JDK,GIT,IDEA,MYSQL,Navicate。。。等等)都安裝完成後,就開始專案的下載。 下載專案: 在使用IDEA下載的過程中就發現了新的問題---根據gitlab中專案的

Push failed: Failed with error: fatal: Could not read from remote repository.

在碼雲賬號上把專案轉移到組織後報的異常Push failed: Failed with error: fatal: Could not read from remote repository或者異常fatal: remote origin already exists以上都市

Push failed. Failed with error: fatal: Could not read from remote repository.

在往github 倉庫提交的時候出現以下錯誤。 Failed with error: fatal: Could not read from remote repository.      此原因是因為ssh公鑰有問題,因為之前電腦是以前的同事用著,我直接就改為自己的賬號

Git push Access denied exec request failed on channel 0 fatal: Could not read from remote repository

Git push 和pull時沒有許可權首先去碼雲/git下 檢視是不新增 公鑰 如果沒有,把開發環境中的.ssh/id_pub進行貼上 至 碼雲那邊的git公鑰,再重新pull即可其次可以去專案中的 .Git資料夾下 config下 進行檢視url是否和遠端倉庫的的url一

Idea:Fetch failed: fatal: Could not read from remote repository

今天在idea工具中fetch github倉庫報錯:Fetch failed: fatal: Could not read from remote repository 查了以下需要調整下settings: 依次選擇:File--Settings,找到下圖的選項選擇

git: fatal: Could not read from remote repository

nag fatal choose native tell ack arch manage fat This is probably an Intellij problem. Your key are managed natively by ssh, and Intellij

Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights

please sudo _id ima upd cal .com root pin 第一次提交遇到這樣的情況,怎麽回事呢,我在github上提交了ssh key 的啊。 排查先看看能不能解析, 1.先 ping https://github.com 把ip添加到 ho

git提示錯誤關於錯誤:ssh: Could not resolve hostname github.com: Name or service not known.fatal: Could not read from remote repository.

eight 無法讀取 主機名 github上 錯誤2 winsock nal file drive 關於 Git 使用中出現的錯誤 饑人谷_楠柒 關註 2016.11.02 15:33* 字數 746 閱讀 3607評論 5喜歡 10贊賞 1 關

Permission denied (publickey). fatal: Could not read from remote repository.

ech IT git 生成 兩個文件 tin 一個 繼續 con 執行語句git push -u origin master的時候出現下面的錯誤 Permission denied (publickey).fatal: Could not read from remo

git Permission denied (publickey). fatal: Could not read from remote repository.

問題描述: 最近剛剛學爬蟲,從學長的git上clone到伺服器的時候 出現的這個問題,問題不大吧,估計以後還會遇到。 問題很簡單,就是沒有祕鑰,顯然github不知道你是誰,然後禁止你拉取程式碼。 原理:本地生成祕鑰,然後新增到GitHub裡面 DONE 解決方法: 1.本地生成祕鑰:

git常見的一些錯誤:fatal: Could not read from remote repository. fatal: Not a git repository (or any of the

錯誤一:fatal: Not a git repository (or any of the parent directories): .git 此錯誤是因為你當前所在的資料夾還沒有git成本地倉庫,確保你是在作為本地倉庫的資料夾下,然後使用:git init   錯誤二:

00 git clone 提示Permission denied (publickey). fatal: Could not read from remote repository.

執行git clone命令為:git clone  xxxxx的時候提示 Permissiondenied (publickey).   fatal:Could not read from remote repository.   Pleasemake sure you have

git push時報錯fatal: Could not read from remote repository.

將本地庫的所有內容推送到遠端庫,輸入命令: git bash報錯: 輸入命令: git bash 輸出: 對比github 兩處地址不一樣。 解決方法: 輸入以下兩個命令列: $ git remote set-url origin ht

bitbucket工程改名導致 repository does not exist. fatal: Could not read from remote repository.

在bitbucket上把工程改名了,就忘了。 結果同步時報錯。 先在本地檢視一下 git remote -v 果然是工程的老名字 origin [email protected]:XXX/oldname.git (fetch)origin [email protected]

git pull時報錯fatal: Could not read from remote repository.

git pull 時 報錯如下資訊:ssh: Could not resolve hostname https: nodename nor servname provided, or not know

Permission denied (publickey) fatal:Could not read from remote repository

安裝了TortoiseGit之後,Eclipse能夠克隆提交操作,但是通過資料夾的方式clone卻總是報Permission denied (publickey)錯誤 ,網上找各種資料都沒有解決。 報錯資訊如下圖: 後面發現TortoiseGit Git clone時 “

【github常見操作和常見錯誤】錯誤提示:Permission denied (publickey). fatal: Could not read from remote repository.

(1)首先新建 SSH key,在git shell(或者git bash等命令視窗),注意大小寫: $ ssh-keygen -t rsa -C “郵箱名” 然後會出現: Generating public/private rsa key

On branch master nothing to commit, working tree clean ERROR: Repository not found. fatal: Could not read from remote repository.

solution not sys lang color node 報錯 mini have 將gitbash部署hexo到github:hexo deploy 報以下錯誤: [email protected] MINGW64 /Hexo $ hex