Configure the ssh key to souretree for use under windows


1. Preparation

1. Install the git client and configure the environment variables


After downloading, just follow the wizard to operate step by step, and the specific steps will not be explained here.

Note: Configure environment variables.


insert image description here


2. Prepare to generate the SSH key file (default file name: id_rsa.rsa)


(1) Open the CMD command line window and execute the following command

 git config --global user.name "xxx"             你自己的名字
 git config --global user.email "[email protected]"    你自己的邮箱

(2) To generate an SSH key, execute the following command and press the Enter key 3 times in succession

ssh-keygen -t rsa -C “[email protected]”   (你的邮箱)

id_rsaAt this time , two private key and public key files will be generated in the .ssh directory id_rsa.pub.


(3) Check the public key, copy the public key as a whole, and configure the SSH public key in the background of the code warehouse

The demonstration here uses the [email protected] code warehouse of CSDN .


A. Open the id_rsa.pub file and copy

B. In the background of gitcode, open the setting interface


insert image description here


C. Open the SSH configuration interface


insert image description here


D. Paste the public key content and save


insert image description here


3. Install the windows version of souretree


2. SoureTree SSH client configuration steps

1. Open source tree

Select Tools -> Options


insert image description here


2. SSH client configuration

SSH key select the prepared SSH private key file;

SSH client chooses OpenSSH.


insert image description here


3. Execute the ssh command, link to the GIT server, and perform public key trust

ssh [email protected]

insert image description here


三、SoureTree Clone

Open the clone window and enter the gitcode ssh address

[email protected]:XXX/XXX.git

insert image description here

Guess you like

Origin blog.csdn.net/lizhong2008/article/details/130498075