gitLab account registration, login, SSH configuration, verification

Preface

The main purpose of this article is to describe gitlab account registration, login function, and how to generate ssh key and add ssh key to gitlab. Use the git tool to pull the code on gitlab locally to verify whether the ssh function is effectively configured.

Register an account

Step 1: Open the gitlab login page through the URL https://gitlab.com/users/sign_in, and click register now below.
Insert image description hereStep 2: Jump to the registration page and fill in the relevant information. Insert image description hereStep 3: Click register to complete registration

Login

Return to the login page and log in to gitLab through the registered account and password.
Insert image description here

Add SSH

Step 1: Open the git bash tool and generate ssh-key through the command (run the command and press Enter until the key is generated): ssh-keygen -t rsa -C ‘[email protected]

Step 2: The generated key is usually in the folder C/Users/xxxx/.ssh. Enter the folder and open the id_rsa.pub fileInsert image description hereStep 3: Copy the ssh key
Step 4: Log in to gitLab, click the drop-down menu in the upper right corner, click PreferencesInsert image description here Step 5: Click SSH Keys and copy the id_rsa.pub file Copy and paste the key in to the position in the picture, and click Add keyInsert image description here
At this point, we can pull and upload the code through git commands.
For the installation and configuration of git tools and TortoiseGit tools, refer to the following documents:
Git&TortoiseGit tool installation

Verify configuration

Verify whether the above configuration is valid by successfully pulling the code.

Step 1: Created your own project on gitlab
Step 2: Find the project you created by clicking Your Work
Insert image description hereInsert image description here Step 3: Enter the project, Copy Clone UrlInsert image description hereStep 4: Pull the code to the local through the TortoiseGit tool.
Insert image description hereInsert image description here
Insert image description hereNote:
If this is the first time you connect to gitlab through ssh, you will be prompted whether you want to connect to the host when downloading the code. Click to confirm. . A successful connection will generate a known_hosts file in the .ssh folderInsert image description hereInsert image description here

This shows that the above configuration is valid. You can happily enable code editing, uploading and other functions.

Guess you like

Origin blog.csdn.net/zhuyonghou/article/details/130854348