Tag: git
When we clone a project from GitHub or gitlab or participate in a project, we need to prove our identity. One possible solution is to add the account name and password to each access, and save a unique key locally, you can also save this key in your account and include it when you access it. GitHub and gitlab use keys to verify your identity and use RSA Algorithms to generate this key.
Link Method
- First, you need to have an account on GitHub or gitlab.
- Open git bash and enter the command LS-Al ~ /. Ssh. Check whether id_rsa.pub or id_dsa.pub exists. If yes, skip step 1.
- In git bash, type ssh-keygen-t rsa-c "[email protected]". Replace the email address with your own email address. After the following output is displayed, press Enter. Then it is displayed as follows: here we can see that the id_rsa and id_rsa.pub files have been generated. The generated path is also displayed.
- Open the id_rsa.pub file with notepad and copy all the content.
- Open the SSH key tag in your gitlab or GitHub account. Select the Add SSH key button, paste the copied content, and click Add key.
After all the operations are completed, as long as you have permissions for the project you want to operate on, you can perform git operations smoothly.
Create an SSH key to connect to GitHub or gitlab