So I have a local repo and a server with git installed and a git user.
I want to send (push) the repo to the server. When I simply login to the server via ssh
I have to specify my .pem file and a passphrase.
The following:
sudo git push [email protected]:somerepo.git
throws this error:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Another attempt another error:
git push ssh://[email protected]:somerepo.git
ssh: Could not resolve hostname : Name or service not known
fatal: The remote end hung up unexpectedly
sudo
?sudo
is the cause of more problems than it solves (in the hands of a novice). But thesudo
down and step away.