git adds SSH public and private keys

Source: Internet
Author: User
1. Configure the GIT environment

Please download the latest version of the Git client from the GIT website. (Note, please bring your own ladder)

After installing the client, you need to complete the following configuration:

Configure User Name

Confirm that you are in the Csdn ID, get the way is after login, enter Passport.csdn.net, at the bottom of "personal account" to view the user name:

Then, on the command line, enter:

git config--global user.name "CSDN id"

Configure the Mailbox

The configured git mailbox should match the registered mailbox in CSDN Passport, and the system determines that the user name depends on the mailbox information:

git config--global user.email "CSDN Passport registered mailbox"

Check Configuration

Finally check that User.Name and User.email are configured correctly:

Git config-l
2. Add SSH public key

A public key is a way of authenticating code to identify your users, and with a public key, you can connect a local git project to code, and then you can easily upload the local code to code or download the code to local.

The following describes how to generate public keys and manage public keys. If you're using a Windows system, you'll need to install Git's Windows client msysgit, then run git Bash and enter the following code in the popup terminal.

Generate Public key

First check the native public key:

$ CD ~/.ssh

If prompted: No such file or directory indicates that you are using Git for the first time. If you are not using it for the first time, do the following to clean up the original SSH key.

$ mkdir key_backup
$ cp id_rsa* key_backup
$ rm id_rsa*

To generate a new key:

$ ssh-keygen-t Rsa-c "your email address"

In the carriage return you will be prompted to enter a password, which will be used when you submit the project, if it is empty, you do not have to enter the project.

You can find an. ssh file in your user folder under your native system disk, where the SSH key that you just generated is stored in the Id_rsa.pub file.

Add Public key

Login to the Code platform, enter the user "account Settings", click on the right side of the column "SSH Public Key Management", click "Add Public Key", the public key just generated to fill in the "Public Key" column, and give it a name, save it.

Note: Do not copy extra spaces when copying the public key, otherwise the addition may not succeed. 3, recommend a git helper tool: tortoisegit Download Address
Introduction to use

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.