ssh connection configuration gitlab

A, SSH Key Configuration:

1, Git hair global configuration:

1 git config --global user.name "username"
2 git config --global user.email "[email protected]"\

2, opening the local Git the bash , enter the following command to generate public and private keys: 

1 ssh-keygen -t rsa -C '[email protected]'

 Then you can enter all the way;

3, and then open the ~ / .ssh / id_rsa.pub file (~ indicates the user directory, such as my windows is C: \ the Users \ Administrator) , copy its contents;

4, open gitlab, find the Profile Settings -> SSH Keys ---> Add SSH Key, and paste the previous step to copy the contents to Key corresponding text box in the Title corresponding text box to the sshkey set up a name, click on the Add key button;

5, at the command line, enter: git clone git @ xxxxxxxxx can be downloaded to a local source;

Two, TortoiseGit the SSH configuration:

1, open TortoiseGit the installation path bin directory, open puttygen.exe file;

2, click on the menu item " Conversions -> Import Key ", the pop-up dialog box, select " ~ / .ssh / id_rsa " file, then click on " the Save Private Key " button, you can save an extension ppk file ;

3, open TortoiseGit \ bin under pageant.exe file, click on the " the Add Key " to select the step to save the ppk file, then you can use TortoiseGit download the source code;

4, set the pageant boot from the start:

1 "C:\Program Files\TortoiseGit\bin\pageant.exe" C:\Users\{username}\.ssh\id_rsa.ppk

 

References: 

https://www.cnblogs.com/hafiz/p/8146324.html

https://blog.csdn.net/hbiao68/article/details/84912587

Guess you like

Origin www.cnblogs.com/laoxia/p/12611478.html