Installation and connection Git Github

Download and install Git, download address: https: //git-scm.com/download/win.
Enter git Git test is successfully installed on the command line.

  1. Right-click the desktop to open Git Bash Here, or open the icon.
  2. Set user.name and user.email

    git config --global user.name "quotes fill Github username"
    git config --global user.email "quotes fill Github registered mail."

  3. Generate ssh key file:

    ssh-keygen -t rsa -C "quotes fill Github registered mail."

Been enter, will generate a carriage return after three .ssh folder, the folder there are three files.
id_rsa private key is
id_rsa.pub public key is
known_hosts

  1. Adding the public key to GitHub

Open id_rsa.pub copy inside the public key, direct access https://github.com/settings/keys (you can also click on the upper right corner to open the GitHub Home avatar selected settings selection keys), select New SSH key, title can not fill the copy paste the public key into the key and then click on the Add SSH key.

  1. Test whether the connection is successful

git input

ssh [email protected]

There will be connection information Connection reset by ... port 22, also or other connection information, if not wrong or can not find the file, all OK.

Guess you like

Origin www.cnblogs.com/timewood/p/11110977.html