How to push repo from git

Suresh Kumar February 10, 2013

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

1 vote
Answer accepted
aMarcus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 10, 2013

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.

Suresh Kumar February 14, 2013

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?

aMarcus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 14, 2013

You need to update your remotes.

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

Suresh Kumar February 15, 2013

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.

aMarcus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 18, 2013

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events