How to push repo from git

Hi,

I'm having github files and i have remote for that. Now i want to use bitbucket. So for that i have added new ssh key. Now my problem is, i'm trying to push the files form local disk to bitbucket.

Its Showing error like " Permission denied (publickey). Fatal: could not read remote repo. Please make sure you have the correct access rights and repo exists. "

Please help me...

1 answer

1 accepted

This widget could not be displayed.

Suresh,

You can test immediately if your key is loaded properly by doing the following:

ssh -Tv git@bitbucket.org

If this fails, then you'll need to double check your settings as noted in our documentation:

  • Add the key in Bitbucket
  • Add the key in your ~/.ssh/config file like
Host bitbucket.org
 IdentityFile ~/.ssh/my_key_rsa

  • You've updated the remote to point to Bitbucket
git remote add bitbucket git@bitbucket.org:{username}/{repo name}.git

Finally, if this still isn't working for you. Check out our troubleshooting guide.

Thanks Marcus...

I tried to clone my repo...It works fine. I have push the file using git push <URL> command. I cannt use repo reference name. Why?

You need to update your remotes.

git remote -v
git remote rm origin
git remote add origin git@bitbucket.org:{username}/{repo slug}.git

Thanks...

I did git remote add https://{username}@bitbucket.org/{username}/{repo slug}.git.

I tried with git remote add bitbucket.org/{username}/{repo slug}.git and it returns error like Permission denied (publickey), Could not read from remote repo.

I left off the 'origin' specification in my example. Try that again.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,181 views 8 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you