Git installation and multi-SSH Key Management

Source: Internet
Author: User
Tags ssh git client

Install git under Windows

1. Download Git https://git-for-windows.github.io/

2. Installation

Installation: Click Next



In the "Configuring the Line Ending Conversions" option,
First option: If it is a cross-platform project, install in Windows system, select;
Second option: If it is a cross-platform project, install in Unix system, select;
Third option: Non-cross-platform project, select.


Right-click on Git Bash to use it after installation is complete

Installing the Tortoisegit git client tool

1 Downloads https://tortoisegit.org/download/

Select the location of the installation next


Download and install language Packs Language pack below




Git manages multiple SSH keys

Configuration generation for multiple local SSH keys

1 Configuring a GIT user name and password

git config user.name "Your user name"

git config user.email "youremail@email.com"

2 specifying the saved file name when SSH key is generated

Ssh-keygen-t rsa-f ~/.ssh/id_rsa.github-c "youremail@email.com"

The Id_rsa.gihub and id_rsa.github.pub two files will be generated in the ~/.ssh directory after you finish specifying

Id_rsa.github.pub is the key that we're adding to the server.

Modifying a configuration file

Create a new config file under the ~/.ssh directory

Add content

# Gitlab

Host gitlab.com

HostName gitlab.com

Preferredauthentications PublicKey

Identityfile ~/.ssh/id_rsa

# GitHub

Host github.com

HostName github.com

Preferredauthentications PublicKey

Identityfile ~/.ssh/id_rsa.github

Test

$ ssh-Tgit@github.com

Tips for Success:

Hi user! You ' ve successfullyauthenticated, but GitHub does not provide shell access.

$ ssh-t git@gitlab.com

Tips for Success:

Welcome to GitLab, user!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.