Problems pushing to remote repository (GitHub)

0

I'm having a really hard time putting a project in GitHub . First, when I try to push push via ssh the following error appears:

Then,totrytoescapetheerror,ItriedtodoviaHTTPSandthemessagepresentedwasasfollows:

I re-created the folders with project, created new repositories and reconfigured the user git . I do not know what else to do.

    
asked by anonymous 03.12.2017 / 01:28

1 answer

0

You need to generate your public and private key with your user (not as root) type in the terminal

ssh-keygen -t rsa -b 4096 -C "[email protected]"

With this command your key pair will be generated in the ~ / .ssh directory after the keys are generated in your github click on your profile picture and click the Settings item on the page that opens on the right side you will have a menu with the item SSH and GPG keys click on it and the screen that opens click on "New SSH Key" will open a screen with two fields Title and Key in title you can put a title that identifies the key eg Key notbook, work key etc. In the key field you must copy the content of your public key, enter the terminal with your user

cd ~/.ssh
cat id_rsa.pub

The command cat will print the key in the terminal copy all the content and paste in the field key then click on "Add SSH Key" after doing this you should be able to use the ssh repository without problems

    
31.01.2018 / 21:16