Install git under Ubuntu and test

Source: Internet
Author: User

Use Git for a long time under Windows system. Try git under Linux, and I'll summarize the first time I've installed git in an Ubuntu environment.

First, enter the git command.

One, install

If the system does not have Git installed, it will be very friendly to prompt for the git command: apt-get install git

Installation process:

Because the old software source was previously added (replaced) by Apt-get, it can be installed directly, and if the git source is not found at this point, you need to add the resource (this procedure is omitted here).

The installation is complete at this time.

Two, do git configuration

Command git config--global user.name ' XXXXXX '

git config--global user.email ' [email protected] '

Third, generate the public key

After the configuration is complete, you need to create a public key for validation, because git it accesses the repository in a ssh way that requires you to create a locally validated file. Use ssh-keygen -C ‘[email protected]‘ -t
the command mailbox as the email address you just entered. The generated public key is under the current folder.

Enter the name saved by the public key, enter the password (not blank), and confirm the password (not blank).

Four, upload the public key

Find the public key file generated by the previous step, my name is Key.pub

Open http://git.oschina.net/(Open source China Code cloud) or https://github.com/(GitHub)

Kaiyuan China is set as follows: Modify data--->ssh public key

GitHub settings are as follows: setting-->

Kaiyuan China is set as follows: Modify data--->ssh and GPG keys---->new SSH Kes

Click Add to complete the upload. (PS: If there is no code cloud or GitHub account, please apply for an account, the application process will not repeat here).

Five, test

Cloning is complete, which means that Git has been successfully installed on Linux. (*^__^*)!

Install git and test under Ubuntu

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.