1.git push -u origin master error
C:\Users\Administrator\AndroidStudioProjects\flutter_app5>git push -u origin master
[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.
wrong reason:
Computer public key (publickey) was not added to github, it is not recognized. Thus need to obtain the public key of the local computer, and then log github account, add the public key to github on OK
Solution:
See if there is a local SSH key: cd ~ / .ssh
1) If there is: cat file name .pub
Copy the key, and then log on github, enter your personal settings to add to. self-named title
2) 1. If no: generating a secret key
ssh-keygen -t rsa -C “youremail”
key easily filled, preferably directly enter the default! The latter two are password, you can fill in, do not fill in
2. Check the contents of the secret key
cat id_rsa.pub
rsa.pub the default secret key generated by the key, if your key fill, the file name can be changed to your key
Copy the keys displayed after login github, enter your personal settings to add to. self-named title
3. Test
$ ssh -T [email protected]
As display content that is success