If you do not install Git, you do not have the public key and private key. If you upload your code to a remote repository, you need the private key to verify that you have uploaded it.

Open git bash and execute the following two commands

Git config --global user.email git config --global user.emailCopy the code

User name to see their favorite, are generally up some easy to remember, or a short, mailbox choose their mailbox.

SSH configuration

  1. Open thegit bash.
  2. usecd ~/.sshYou can check whether the configuration is completeSSH.
  3. Execute commands to generate public and private keysssh-keygen -t rsaAnd press Enter 3 times (why press enter 3 times, because there is a prompt whether you need to set the password, if set each time useGitWill use the password, generally is not directly write as empty, directly enter). A private key is generated in a folderid_rsaAnd a public keyid_rsa.pub. (executablestart ~The generated public and private keys are in the.ssh folder.
  4. .ssh is stored in C:\Users\Administrator unless special handling is performed. If you cannot see the.ssh file, use itls -ahCommand to view the hidden folder, this is the file where the secret keys are stored, open this file will seeid_rsaandid_rsa.pub.id_rsaIt’s a private key file,id_rsa.pubIs a public key file.
  5. Run the command to view the public keycat ~/.ssh/id_rsa.pub.

Reproduced in: www.jianshu.com/p/73018a8d1…