If you encounter one of the problems in git on your system(ubuntu) : fatal: unable to access ‘xxx‘: gnutls_handshake() failed: Error in the pull function. or OpenSSL SSL_connect: Connection reset by peer in connection to api.github.com:443 you can use these steps and solve your problem:
-
create a new rsa key in your system in first step you should create a new ssh key:
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
-
install gh on your system
$ sudo apt update
$ sudo apt install gh
-
login to gh login with gh to cli and select ssh for in authentication steps.
-
and then upload this file to github by gh:
$ gh ssh-key add ~/.ssh/id_rsa.pub
-
and then to set the correct permissions, use the command:
$ sudo chmod 600 ~/.ssh/config
-
and then clone repository with ssh:
$ gh repo clone git@github.com:myCompany/myrepo.git