我在Bitbucket中添加了ssh密钥。如果我做ssh -T [email protected]
他说我已经登录了。但是当我做一个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 = [email protected]:myUserName/myGitRepo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "heroku"]
url = [email protected]:herokuUrl.git
fetch = +refs/heads/*:refs/remotes/heroku/*
[branch "somebranch"]
remote = origin
merge = refs/heads/somebranch
如果我做:
git remote -v
打印出来:
heroku [email protected]:herokuUrl.git (fetch)
heroku [email protected]:herokuUrl.git (push)
origin [email protected]:myUserName/myRepo.git (fetch)
origin [email protected]:myUserName/myRepo.git (push)
我得到了相同的消息,我不得不从路径中删除我的用户ID ....所以而不是:
url = [email protected]:myUserName/myGitRepo.git
有用的是:
url = [email protected]:myGitRepo.git
此错误是因为您在bitbucket上重命名。首先你检查一下:
git remote -v origin [email protected]:OldName/wp_tanhoangminhgroup.com.vn.git
那么你必须改变新名称下的路径
git remote set-url [email protected]:NewName/wp_tanhoangminhgroup.com.vn.git
确保您没有在Bitbucket存储库的设置中的“部署密钥”下添加SSH密钥。您实际需要做的是在“管理帐户”(单击您的头像)>“SSH密钥”下添加SSH密钥。有一个explanation in this post