11

I have the ssh keys added in Bitbucket. If I do ssh -T git@bitbucket.org he says I'm logged in. But when I do a git push/pull I get the following message

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.

My cat .git/config outputs:

[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

if I do:

git remote -v  

prints out:

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)
tvieira
  • 1,865
  • 3
  • 28
  • 45
  • 1
    config looks fine, does repository realy exist, and how did you managed to copy key https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git ? – klerk Jul 21 '14 at 22:25
  • 1
    yup, I edit with the result of the `git remote -v` – tvieira Jul 21 '14 at 22:28

3 Answers3

11

I got the same message, and I had to remove my user id from the path.... So instead of:

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

What worked was:

url = git@bitbucket.org:myGitRepo.git
o11c
  • 15,265
  • 4
  • 50
  • 75
brain
  • 126
  • 1
  • 3
  • Sharing [my answer](http://stackoverflow.com/a/34270097/2404470) for future readers – Zameer Ansari Dec 14 '15 at 14:59
  • In my case, I updated and set remote by omitting the user ID from this command. This solved the issue for me: git remote set-url origin git@bitbucket.org:myGitRepo.git – seamusjr Mar 12 '19 at 15:53
5

This error is because you renamed on bitbucket. First you check:

git remote -v origin git@bitbucket.org:OldName/wp_tanhoangminhgroup.com.vn.git

then you must change the path under new name

git remote set-url git@bitbucket.org:NewName/wp_tanhoangminhgroup.com.vn.git
Sanji
  • 109
  • 1
  • 5
  • 3
    path change command would be : `git remote set-url origin git@bitbucket.org:NewName/wp_tanhoangminhgroup.com.vn.git` . You missed `origin` – Arif Mar 18 '18 at 04:00
2

Make sure you're not adding the SSH key under "Deployment Key" in your Bitbucket repository's settings. What you in fact need to do is add the SSH key under "Manage Account" (Click your Avatar)> "SSH Keys". There's an explanation in this post

Community
  • 1
  • 1
osehgol
  • 111
  • 1
  • 5