Register and install the git version control tool in CentOS6.564

Source: Internet
Author: User

Register and install the git version control tool in CentOS6.564

I. Description

This article describes the entire process of Linux CentOS6.5 64-bit registration and installation of the git version control tool. Git is a distributed version control system, originally written by Linus Torvalds and used for Linux kernel code management. As an open-source code library and version control system, Github has more than 1.4 million developers. As more and more applications are migrated to the cloud, Github has become the preferred method for managing software development and discovering existing code.

2. install and use git

1. Register a free account on the GitHub official website and create your own code Repository (Repository)

GitHub official website registration address: https://github.com/join, as long as you enter the user name, mailbox and password can be registered successfully.

After successful registration, log on to the GitHub website, click the "gear" button in the upper right corner, that is, the setting button to go to the home page of your personal account settings, and click the "create Repository" button, you can create a repository by naming it yourself.

2. Configure ssh remote connection to GitHub on the centos command line

Create an ssh key locally:

 

[yuehong@tong root]$ sudo ssh-keygen -t rsa -C "username@xx.com"
 

 

Note: The email address after-C is the one you registered with the GitHub account on the official website. Enter the email address based on your own email address.

Press enter when generating the key to keep the default value. In this way, the files id_rsa and id_rsa.pub will be generated under the. ssh folder in the Linux user's home directory.

My Linux user name is yuehong, so the generated key file is in the;/home/yuehong/. ssh directory, view the content of the id_rsa.pub file and paste it to the key of the SSH Keys:

 

[yuehong@tong .ssh]$ cat id_rsa.pub
Go back to the github website and go to Account Settings. On the left, select SSH Keys, Add SSH Key, and enter the title. paste the key to copy the content of the id_rsa.pub file to the key text box. Details 

 

Click add SSH Key. In the displayed dialog box, enter titile as needed. The content in the key text box is id_rsa.pub.

Run the following command on the Linux Command Line to test the ssh connection:

[Yuehong @ tong. ssh] $ ssh-T git@github.com

The following message is displayed, indicating that the connection test is successful:

The above sets up a connection between the local machine and GitHub. If git is installed on your local machine, you can start to download, debug, and upload git source code. If git has not been installed, then go to the next step to install git.

3. Install git1.7.1 on the 64-bit CentOS6.5 Operating System

We use yum installation here, three files are required: geekery-el6-x86_64.repo, rpmforge-release-0.5.3-1.el6.rf.i686.rpm, epel-release-6-8.1.noarch.rpm.

Three files: http://download.csdn.net/detail/tongyuehong/8592143

If you want to download other versions, the official websites of these three files are:

Http://geekery.altervista.org/dokuwiki/doku.php

Http://pkgs.repoforge.org/rpmforge-release/

Http://rpm.pbone.net/Enter epel-release in the input box and select search for rpms by name as the search type

3.1 copy the three downloaded files to the/etc/yum. repos. d/directory.

3.2 run the following three commands in the directory:

 

[tong@tong yuehongSoftware]$ sudo rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm[tong@tong yuehongSoftware]$ sudo rpm -ivh epel-release-6-8.1.noarch.rpm [tong@tong yuehongSoftware]$ sudo yum install git -y

 

The following message indicates that the installation is successful:

Run the following command to view the git version:

[Tong @ tong yuehongSoftware] $ git -- version

Git version 1.7.1

4. Use git to download source code from GitHub

For example, in step 1, "create Repository" (create a warehouse) is named hadoop. Click the name of the created warehouse, copy the https address on the right, and click clone URL.

Run the following command:

[Yuehong @ tong repos] $ sudo git clone git@github.com: tongyuehong/hadoop. git

The above is our github repository address, format: sudo git clone git@github.com: GitHub account name/your own repository name. git, you just need to change to your own copy address.

Related Article

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.