Distributed code Management System git

Source: Internet
Author: User

1.1Git Installation

CentOS on Yum install-y epel-release; yum install git

Ubuntu on Apt-get Install git

Install Msysgit on Windows

Https://git-for-windows.github.io

After the installation is complete, you will need to set the final step

git config--global user.name "Your name"//For example Snale

git config--global user.email "[email protected]"//Own Mailbox

Note that the parameters of the git config command, --global using this parameter, means that all of your git repositories on this machine will use this configuration, of course, you can also assign a different user name and email address to a warehouse.

1.2 Creating a warehouse push file

 Mkdir/data/gitroot

Cd/data/gitroot

GIT init//Initialize with this command to make this directory a repository that git can manage

List-a can see a more. Git directory

Echo-e "123\nsnale\ngittest" >gittest.txt

git add gittest.txt//adding files to the Warehouse

Git commit-m "Add test file Gittest.txt"//add must commit in order to actually commit the file to the warehouse

Echo-e "11111\n222222" >>gittest.txt//Change file

git status//view the status in the current repository, such as whether there are any changes to the file

git diff gittest.txt//Can compare the version of the repository with the gittest.txt compared to what is changed this time

Distributed code Management System git

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.