Configuring Git under Linux CentOS

Source: Internet
Author: User
Tags version control system

1   GitIntroduction

What is Git? Git is currently the world's most advanced distributed version control System (no one). What are the characteristics of Git? Simply put: high-end atmosphere on the grade!.

2   GitComponent Installation

# yum–y Install git

3   ConfigurationGitWarehouse

due to the company's environmental needs, this document in accordance with the company environment configuration.

1. Configure access keys

# Ssh-keygen

2. Copy the client's 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 performed in the scheduled warehouse directory )

5. add allow access to users

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

4   Gitcommon commands for clients

1. Add

# git add file

2. Delete

# git rm file

3. Submit Changes

# git Commit–m " Memo info "

4. Submit

# git push

5. Update

# git Pull

6. Clone Warehouse

# git clone git access address and directory

7. View file status

# git status

8. Renaming files

# git mv file new file

9. View Log

# git log

10. Compare file differences

# git diff

11. Clone Library

You can use the following command to clone a code base because the production environment is sometimes required

# git clone--bare repos


This article is from "Xiao Huan" blog, please be sure to keep this source http://x1aoxiao.blog.51cto.com/1836651/1655748

Configuring Git under Linux CentOS

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.