Git Version Management Basic operations

Source: Internet
Author: User

Git is a version management operation tool very n, can be very intelligent distributed management,

Installation

Yum-y Install git

Local Settings Global

Tell who submitted the code information

# git config--global"xxx"--global"xxx "
Color settings
# git config--global color.ui true

Initializing the Warehouse

# mkdir oldboy# cd Oldboy/ in

Submit a Code Flow

first create the file #cat readme.txt 1 hehe Adding # git add readme.txt    "  "[Master (Root-110 deletions (-  100644 Readme.txt View state #git Status

Fallback version

# git reset--hard head^   ^ indicates last version ^^ represents the last two versions of fallback specified version # git reflog8b1cc8f [email protected]{0} : head^: Updating head10c245e [email protected]{1}: Commit:add 2hehe8b1cc8f [Email protected]{
    2}: commit:the 2th commit9ec14f1 [email protected]{3--is now at 9EC14F1 the first commit

Git checkout--readme.txt #从新拉取数据

Remote Warehouse

Create a repository on GitHub and then add the local public key to the Ssh-key in setting above GitHub

locally created secret # SSH-keygen-t RSA public key uploaded to setting set SSH key
#cd/root/oldboy#git Remote Add origin [email protected]:yefei520/demo.git#git pull#git Pull-u Origin Master

GitHub is relatively slow and public in foreign countries if you want to encrypt the money but there is open source Gitlab open source software can replace GitHub we open the next chapter how to install Gitlab

Git Version Management Basic operations

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.