Regentix
Regentix

Reputation: 291

Unable to push to newly created Bitbucket repository

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?

Upvotes: 1

Views: 97

Answers (1)

Regentix
Regentix

Reputation: 291

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.

Upvotes: 2

Related Questions