Configure git in CentOS

Source: Internet
Author: User
Tags git client

Configure git in CentOS
1 git Introduction

What is Git? Git is currently the most advanced distributed version control system in the world (none ). What are the characteristics of Git? To put it simply, the high-end atmosphere is superior !.

2Git component Installation

# Yum-y install git

3. Configure the git Repository

This document is based on the company's environmental requirements.

1. Configure the access key

# Ssh-keygen

2. Copy the client key to the git Server

# Ssh-copy-id

3. Create a git repository directory

# Mkdir/data/www/repos

4. Create a git Repository

# Cd/data/www/repos

# Git init -- bare sample. git (must be executed in the pre-defined repository directory)

5. Add users allowed to access

# Git config -- global user. name "root"

4 common git client commands

1. Add

# Git add File

2. Delete

# Git rm file

3. Submit changes

# Git commit-m "Remarks"

4. Submit

# Git push

5. Update

# Git pull

6. clone a repository

# Git clonegit access address and Directory

7. view the File status

# Git status

8. rename a file

# New git mv File

9. View logs

# Git log

10. Comparison of file differences

# Git diff

11. clone a database

The following command can be used to clone the code library because it is sometimes required in the production environment:

# Git clone -- bare repos

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.