'I get this error [email protected]: Permission denied (publickey), when I git push on new mac
I got a new mac, so I copied a file from old mac and pasted into new mac then made some change then enter command "git push" and I get this error message
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
For this particular file, in my old mac, I always had to enter passphrase whenever I git pushed. Other repos, I didn't have to enter passphrase. So I set this up differently than others. It was couple years ago so I forgot how I set this up. My guess is problem has to do with SSH key, but not quiet sure what I need to do to make this repo work again in new macbook. What do I need to do?
Solution 1:[1]
You don't have your ssh key set up properly (or at all). You'll need to copy your ssh private key from your old Mac to your new Mac. Everything you need will be in a directory at ~/.ssh.
One way to copy the folder: http://www.techkaki.com/migrate-ssh-keys-from-one-mac-computer-to-another/
If a new ssh key needed, follow this: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Lukas Oberhuber |
