git download code ssh password-free settings

Now that git is used as code management, it is very common. When entering a company, if you use git, it is indispensable to set up ssh secret-free steps when you develop a development environment. For the convenience of yourself and everyone, record it.

  1 If it is a windows environment, some command lines may not be used normally with the terminal that comes with the system. If you have installed the git client, then this problem can be solved, you can use the git terminal (git bash) to operate, don't worry about mac. details as follows:

  Enter the command: ssh-keygen -t rsa -C "[email protected]"  

  Then you can always press Enter, or you can enter the password to see the individual. If it already exists, it will prompt whether to overwrite (overwrite). After the completion, there will be a prompt, the location of several files generated by this command, pay attention to it, it is probably the following improvement:

  Your identification has been saved in /home/you/.ssh/id_rsa. 

# Your public key has been saved in /home/you/.ssh/id_rsa.pub. 

# The key fingerprint is: # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db [email protected]

 

2 If it is a mac, you can directly enter the command in the terminal: cd ~/.ssh If there is, you will also see several files such as id_rsa, id_rsa.pub, etc. If not, enter the command marked in red.

 

3 Then open the id_rsa.pub file, this file is the public key, copy the content inside, log in to the company's git address, on the left side of the page 

There is one in the list: Profile Settings option, select this, then you will see the SSH KEYS option on the left, click it, there is a button add ssh keys in the upper right corner, click this to paste the content of the public key you just copied , and finally submit it.

 

4 At this time, note that if you want to download the code, you need to restart the terminal and you can use it.

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326322243&siteId=291194637