征服:仓库不存在。致命错误:无法从远程仓库读取。

11

我已经在Bitbucket上添加了SSH密钥。如果我运行ssh -T git@bitbucket.org,系统会显示我已成功登录。但是当我进行git push/pull操作时,会出现以下消息:

conq: repository does not exist.
fatal: Could not read from remote repository.

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

我的 cat .git/config 输出如下:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
[remote "origin"]
    url = git@bitbucket.org:myUserName/myGitRepo.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[remote "heroku"]
    url = git@heroku.com:herokuUrl.git
    fetch = +refs/heads/*:refs/remotes/heroku/*
[branch "somebranch"]
    remote = origin
    merge = refs/heads/somebranch

如果我执行:

git remote -v  

打印输出:

heroku  git@heroku.com:herokuUrl.git (fetch)
heroku  git@heroku.com:herokuUrl.git (push)
origin  git@bitbucket.org:myUserName/myRepo.git (fetch)
origin  git@bitbucket.org:myUserName/myRepo.git (push)

1
配置看起来没问题,仓库真的存在吗?你是如何复制密钥的?https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git - klerk
1
是的,我使用 git remote -v 命令的结果进行编辑。 - tvieira
3个回答

11

我收到了相同的消息,而我必须从路径中删除我的用户ID... 所以不是:

url = git@bitbucket.org:myUserName/myGitRepo.git

成功的方法是:

url = git@bitbucket.org:myGitRepo.git

分享我的答案给未来的读者。 - Zameer Ansari
在我的情况下,我通过省略此命令中的用户ID来更新和设置远程。这对我解决了问题:git remote set-url origin git@bitbucket.org:myGitRepo.git - seamusjr

5
这个错误是因为您在Bitbucket上重命名了。首先,请检查以下内容:
git remote -v origin git@bitbucket.org:OldName/wp_tanhoangminhgroup.com.vn.git

那么您必须更改新名称下的路径

git remote set-url git@bitbucket.org:NewName/wp_tanhoangminhgroup.com.vn.git

3
修改路径的命令应该是: git remote set-url origin git@bitbucket.org:NewName/wp_tanhoangminhgroup.com.vn.git。你漏掉了 origin - Arif

2

请确保您没有将SSH密钥添加到Bitbucket存储库设置中的“部署密钥”下。实际上,您需要在“管理帐户”(单击您的头像)>“SSH密钥”下添加SSH密钥。这篇文章中有一个解释


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接