Clone GitHub project using HTTP, and the login box will pop up (as shown below). Switch to the procedure for configuring SSH keys before SSH cloning

  • Generate the SSH Key
  1. Use the shortcut keys Shift + Alt + A to open the MinGW terminal or sourceTree-> Operations -> Open in terminal
  2. Enter the following command, there will be three problems, directly press Enter:

ssh-keygen -t rsa -C "[email protected]"

  • Add the SSH public key to the GitHub account
  1. Copy the SSH public key from ssh-RSA to mailbox.

    You can find the file location by path or run the following command to obtain the file location/c/Users/chenjs/.ssh/id_rsa.pub



  • Test whether SSH authentication succeeds

    Enter the following command to test the SSH linkssh -T [email protected]If the following prompt is displayed, be sure to enter yes and press enter, do not enter to indicate agreement, usually used to directly enter, pay attention to.

    Finally, enter the above command to test:

Set sourcetree to SSH

  • Open Sourcetree and choose Tools > Options

    Select OpenSSH on the SSH client configured on the SSH client

  • Click Remote> Add a new account, as shown in the picture

Cloning projects