1

I'm trying to push my local git repository to my newly created Bitbucket repository.

What I did:

  1. git init
  2. git remote add origin [email protected]:USERNAME/REPONAME.git
  3. git add .
  4. git commit -m 'Initial commit'
  5. git push -u origin master

Instead of pushing, I receive:

repository does not exist. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 

When I cat .git/config, I can see the correct URL which should be used:

url = ssh://[email protected]/USERNAME/REPONAME.git

I'm not quite sure why this isn't working. I've set up a repository in the same way yesterday and all went fine.

What am I doing wrong?

3
  • 1
    Have you successfully set up your SSH key? Did you get the remote URL by copying from Bitbucket to ensure there aren't any typos? Commented Apr 25, 2019 at 15:21
  • @Chris, I do. I've always been using SSH. And yes, I always copy the URL to avoid typos. Commented Apr 25, 2019 at 16:16
  • 2
    What does ssh -T [email protected] give? Commented Apr 25, 2019 at 16:24

1 Answer 1

2

I recently changed my Bitbucket username and when I ran ssh -T [email protected] in console, it printed my new username. Whenever I changed it back to my previous username, it all worked.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.