2012-04-17 145 views
9

時未找到我的版本庫GitHub上所謂的「消息」,並與同名的本地倉庫。我試圖將文件從我的本地回購推送到遠程的,但得到這個錯誤:庫推到GitHub的遠程

ERROR: Repository not found.
fatal: The remote end hung up unexpectedly.

我想這是一個身份驗證問題。當我跑

ssh -T [email protected] 

我確實收到一條消息,指出我的密鑰不起作用。所以我將我的〜/ .ssh/github_rsa.pub添加到我在GitHub上的帳戶中的SSH密鑰(刪除了那裏已有的密鑰)並再次運行該命令。這一次,我收到一條消息說 -

Hi septerr! You've successfully authenticated, but GitHub does not provide shell access.

從我看到這似乎是預期的消息。所以,我再次嘗試推動。但收到同樣的錯誤。未找到存儲庫。

Swapnas-MacBook-Pro:messages sony$ git remote -v show 
origin [email protected]:seterr/messages.git (fetch) 
origin [email protected]:seterr/messages.git (push) 
Swapnas-MacBook-Pro:messages sony$ git push -u origin master 
ERROR: Repository not found. 
fatal: The remote end hung up unexpectedly 

當我看着我的回購在GitHub上我看到:

Existing Git Repo?
cd existing_git_repo
git remote add origin [email protected]:septerr/messages.git
git push -u origin master

出了什麼問題?

回答

6

你的遠程地址,對比一下github上告訴你:

[email protected]:seterr/messages.git <== your remote 
[email protected]:septerr/messages.git <== GitHub actual repo address 

您在septerr忘記了 'p'。在「GitHub pushing/pulling error」提到

如,GitHub庫地址將錯字或大小寫敏感的。


Nick提到的評論:

I ran into an issue where I needed to change my repo address due to a change in GitHub username.
Here's the code for it:

git remote set-url origin [email protected]:username/reponame.git 

This will set the remote name to origin with the GitHub username of username.

+2

「明智的打字錯誤」。哈哈! +1 – nulltoken 2012-04-17 07:31:51

+1

*砸我的頭*謝謝你們! – septerr 2012-04-18 05:28:36

+1

我遇到了一個問題,由於GitHub用戶名的更改,我需要更改我的回購地址。下面是它的代碼:'git remote set-url origin [email protected]:username/reponame.git' - 這將使用GitHub username用戶名將遠程名字設置爲origin。 – Nick 2012-05-14 19:50:27

13

如果您收到此錯誤和拼寫錯誤是不是原因,因爲是我的情況下,嘗試打開的.git /配置和刪除部分:

[remote "origin"] 
url = [email protected]:yourgitusername/my_project.git 
fetch = +refs/heads/*:refs/remotes/origin/* 

然後重新運行以下(替換 'yourgitusername'):

git remote add origin [email protected]:yourgitusername/my_project.git 
git push -u origin master 

這解決了這個問題對我來說。 感謝這個答案在一個類似的問題:Git Push ERROR: Repository not found

7

我有同樣的問題。我的問題是誤解,我必須先推出github上的空回購。衛生署!包括這裏給其他沒有意識到的人。

0

我也有這個問題,它原來是我沒有授予回購用戶訪問這樣的錯誤信息是有點誤導。

-1

問題是冒號(:)後的用戶名。你應該用斜槓,然後它的工作原理:

混帳克隆SSH://[email protected]/USERNAME/REPONAME。git

分號表示PORT不是用戶名在ssh url中。

混帳克隆SSH://[email protected]:22/REPONAME.git

3

如果您使用的是Mac OS上-X和對遠程一個HTTPS URL無憑據,然後鑰匙串可能用於憑證。

您的KeyChain中的憑據可能不正確嗎?也許你已經改變了你的密碼,或者你有兩個Github賬戶,但錯誤的賬戶正在使用?

如果有疑問請打開KeyChain應用程序並刪除「github.com」條目,然後當您下一步執行提取/拉/推等等時,您將被重新提示輸入您的github用戶名和密碼。

上述所有假設你已經在https://help.github.com/articles/set-up-git#platform-mac

+0

我只有這個問題。謝啦! – shanmugharaj 2017-09-09 02:21:01

1

這可能幫助別人先前啓用的「密碼/鑰匙扣緩存」按照指導,當你把你的SSH密鑰到Github上,你必須添加到您的個人資料設置在您的用戶帳戶而不是存儲庫部署密鑰。

如果您有多個私有存儲庫,這將適用於所有這些存儲庫。我確實犯了一個錯誤,將我的ssh密鑰添加到一個私有存儲庫,所以當我嘗試克隆其他存儲庫時,出現錯誤「未找到存儲庫...」

+0

我希望我能夠這樣做三次!謝謝! – 2017-01-17 19:02:16

0

我聯繫了github支持人員,他們告訴我如果我使用的是Windows機器,請在Windows Credential Manager中檢查我的git憑證。似乎不知何故git證書不正確。我糾正了憑據並推動了工作。