The problem:
Created a remote repository on github and pushed my code to it git push -u origin master with the following error
The authenticity of host ‘github.com (52.74.223.119)’ can’t be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?yes
Warning: Permanently added ‘github.com,52.74.223.119’ (RSA) to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Reason for the problem: Github and ssh connection requires a key
Solution:
1. local mac public key path to get the key: cd ~/.ssh (id_rsa.pub)
2. Login to your own github into the project repository —- into setting —- Deploy keys
3. When configuring the ssh key, check the following Allow write access, the deploy key section in settings to have read and write permissions
4. After the configuration is complete and then go to the project to operate git can
Solution:
git push -u origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 218 bytes | 109.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To git+ssh://github.com/illusion1010/Hog.git
* [new branch] master -> master
Branch ‘master’ set up to track remote branch ‘master’ from ‘origin’.
Similar Posts:
- error: src refspec master does not match any [How to Solve]
- Git Pull Error: Please specify which branch you want to merge with.
- [Solved] Git pull fatal: refusing to merge unrelated histories
- Git error: requested URL returned error: 403
- Git | fatal: refusing to merge unrelated histories [How to Solve]
- git pull There is no tracking information for the current branch.
- Git Push hint: Updates were rejected because the remote contains work that you do hint: not have …
- fatal:’origin’ does not appear to be a git repository fatal:Could not read from remote re…
- GitHub common operations and common errors! Error prompt: fatal: remote origin already exists