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.
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_rsa
At 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
C. Open the SSH configuration interface
D. Paste the public key content and save
3. Install the windows version of souretree
2. SoureTree SSH client configuration steps
1. Open source tree
Select Tools -> Options
2. SSH client configuration
SSH key select the prepared SSH private key file;
SSH client chooses OpenSSH.
3. Execute the ssh command, link to the GIT server, and perform public key trust
ssh [email protected]
三、SoureTree Clone
Open the clone window and enter the gitcode ssh address
[email protected]:XXX/XXX.git