The gitlab has been built above. When creating a new project, it prompts that an ssh key is required to use it. Here is a record of how to generate ssh key, which has been added to gitlab
- Generated on the computer
ssh key
, here you have installed the git tool by default - Open
Git Bash Here
- Input
ssh-keygen
, the following prompts can be entered without input.
The following is the case of input
- Find the file directory of the generated key. I didn’t enter anything here. It is in the default directory of the C drive user. If the directory is entered, it will be in the corresponding directory.
- Add
ssh key
, click the account in the upper right corner, selectPreferences
–>SSH Keys
- Use Notepad to open the public key file
id_rsa.pub
, use the Ctrl+A keys to select all the public key content, and copy the content of the public key file and paste it into the key box of GitLab's SSH Keys, as shown in the following figure:
- The addition is complete. Add the SSH public key to the GitLab server (indicating that the public key added to GitLab by this computer is complete, and the GitLab server already trusts the computer
从本电脑上推送、拉取GitLab上的项目文件都不用密码了
)