Git push doesn't workafter OS X Mavericks upgrade

Heather Baldwin November 4, 2013

I just reformatted my Mac and upgraded to Mavericks. Git no longer seems to be connected to the remote repository.

Git push

results in the error message

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I do not know how to check the access rights and re-establish the connection to the remote repositories. Can anyone help me out?

edited to clarify: after the fresh os install I migrated my documents over, I didn't do a time machine restore.

4 answers

1 accepted

1 vote
Answer accepted
HenriqueA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 4, 2013
I'm sorry, I should have been more clear about the procedure.
I saw that you have created a new Public Key with the command:
ssh-keygen -t rsa -C "myname@example.com"
The next step now, is to add this public key that you created to your Bitbucket account. The following page will guide you through the procedure:
Just a heads up, on the 9th part of the step 6, in which you need run the command: "ssh -T git@bitbucket.org" remember that you need to replace "git" for your user. For instance:
ssh -T heather@bitbucket.org
Regards,
Henrique Lechner
1 vote
HenriqueA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 4, 2013

Hi There,

This error may happen because you don't have a correct public key inside your home directory.

In order to check if this is the case, could you please see if you have the following file: ~/.ssh/id_rsa

This file is responsable for the Public Key on your connection and if you don't have that I suggest that you copy the old one that you had before the format.

There is a method for using the verbose of SSH, which might help us to get a more detailed information about the error:

$ ssh -vT git@example.com

Could you try to use this command and post the result?

Regards,

Heather Baldwin November 4, 2013

Hi Henrique,

I have that file. After reading something about it maybe having to do with the key, I did the following;

ssh-keygen -t rsa -C "myname@example.com"
pbcopy < ~/.ssh/id_rsa.pub

However it still doesn't work. When I tried that command you advised, I got:

computername:~ homedir$ ssh -vT
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-e escape_char] [-F configfile]
           [-I pkcs11] [-i identity_file]
           [-L [bind_address:]port:host:hostport]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-R [bind_address:]port:host:hostport] [-S ctl_path]
           [-W host:port] [-w local_tun[:remote_tun]]
           [user@]hostname [command]

Sorry, I'm still not very good with git...

Cheers,

Heather

Jeff Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 4, 2013

Heather: Since you generated a new ssh key, you'll need to remove your old key from the Bitbucket and add the new one that you just created. These instructions should help.

0 votes
Heather Baldwin November 4, 2013

Thanks Jeff, I followed those instructions and it worked.

0 votes
Heather Baldwin November 4, 2013

Thanks for your response, Jeff. I'm trying to follow the instructions, but I'm struggling with Step 4. When I said I'm not good with git, I meant it. How can I create a new text file and edit it from bash?

Jeff Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 4, 2013

I linked to the Windows instructions, sorry!

Try these - https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events