• notice
  • Congratulations on the launch of the Sought Tech site

Git configure SSH key

Git configure SSH key

1. Generate SSH key

  • Open C:\Users\Account Name\, my computer is C:\Users\Administrator, check if there is a .ssh folder, if not, enter the following command in git base:

    ssh-keygen -t rsa -C "[email protected]"
  • -t rsa indicates that the key type is rsa, which can be left blank.

  • -C "[email protected]" indicates the key ID, which can be filled in at will

  • After executing the command, you need to press Enter three times. The first time is to prompt for passphrase. The second and third times are to prompt for password. You can leave it blank. After you press Enter, the page below shows that the SSH key was created successfully:
    git-sshkey_1.png

2. Add the SSH key to the git account

  • Open the id_rsa.pub file in the .ssh folder with Notepad and copy the entire contents of the file

  • Log in to git, click on the avatar drop-down and select settings to enter the settings page, click on SSH keys on the left

  • Add your own SSH key as shown below:
    git-sshkey_2.png

3. TortoiseGit little turtle settings

  • Enter the little turtle settings page, click Network, and change the ssh client to \usr\bin\ssh.exe in the Git chapter directory, as shown below (if it cannot be saved, check Use a proxy server):
    git-sshkey_3.png

Test whether the configuration is successful

Clone the project using SSH:

  • Click Clone in the folder
    git-sshkey_4.png

  • Fill in the SSH address of Git in the URL
    git-sshkey_5.png

  • The clone is successful as shown below:
    git-sshkey_5 (1).png



Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+