Problems pushing to remote repository (Github)

Asked

Viewed 370 times

0

I’m having a really hard time putting a project on Github. First, when I try to do the push via ssh appears the following error:

printscreen do erro

Then, to try to escape the error, I tried to see HTTPS and the message presented was as follows::

printscreen do erro com o protocolo HTTPS

I recreated the folders with project, created new repositories and already configured the user git. I don’t know what else to do.

  • Did you create this repository? Or are other people using it?

  • I created it. There’s no one else using it.

  • Try to configure the foreign key to get access, see ==> here

  • You have to add a new SSH key to your Github account. help github: https://help.github.com/pt/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account

1 answer

1

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 ~/ directory. ssh after the keys are generated enter your github click on your profile picture and click on the Settings item in the page that opens on the right side will have a menu with the item SSH and GPG Keys click on it and on the screen that opens click on "New SSH Key" will open a screen with two Title and Key fields in the title you can put a title that will identify the key for example Key notbook, Job key etc.. in the key field you must copy the contents of your public key, enter the terminal with your user

cd ~/.ssh
cat id_rsa.pub

the cat command will print the key in the terminal copy all the contents and paste into the key field then click "Add SSH Key" after doing this you should be able to use the ssh repository smoothly

Browser other questions tagged

You are not signed in. Login or sign up in order to post.