简体   繁体   中英

Git publickey permisson denied when trying to push code to github

I get the following error when trying to push code to github.

Permission denied (publickey). fatal: The remote end hung up unexpectedly

I already have setup a key long time ago using my PC and it was working fine on windows machine. Now, I am using my Macbook Pro and it says permission denied. So, I created a new key and copy and pasted the public key on the github website but still it gives the same error.

One thing to look out for when copying and pasting is your key is to make sure there are no extra spaces or line breaks. The text entered is supposed to be one continuous line of text, so make sure you don't have line breaks where the text wraps on Github.

In the key's text box put your cursor at the beginning of each line and press Backspace. If it deletes a character then that means it was ok. If nothing is deleted you took out a line break. Also make sure there are no spaces or line breaks after the last character of the key.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM