Mac sourcetree configuration

Recently I changed a new computer and found that I need to reconfigure sourcetree

Otherwise, when you pull the code, the pop-up box for entering the verification code and accessing the keychain will always pop up

This is because after changing the computer, there is no ssh key added in gitlab in the keychain.

After studying for a long time, I finally got it done, share it, hope it will be useful to you

Step 1: Generate the ssh key of the new computer

Open terminal and enter commands

ssh-keygen -t rsa -C "your username"

It will prompt

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/soulkey/.ssh/id_rsa): 

Then press Enter 3, the relevant information will be printed out, including the path of the ssh key, and it will be generated here.

Part 2: Go to gitlab and add the generated ssh key

Enter the /Users/soulkey/.ssh directory in the terminal

vim id_rsa.pub open the file, copy it, and then add it in the figure below

 

Step 3: Add ssh key to sourcetree

Execute ssh-add ~/.ssh/id_rsawill be sshkeyadded to sourceTree

Step 4: sshkeyAdd to the keychain

Execute ssh-add -K ~/.ssh/id_rsawill be sshkeyadded to the keychain

Step 5: Pull the code

Copy the path in the figure below directly, click New Warehouse-clone from url, paste the path in, select the local path, and it will work.

 

Guess you like

Origin blog.csdn.net/bitcser/article/details/94009000