Version Control git Application

Source: Internet
Author: User
Learning Materials: progit. orgbookzh common operation to retrieve code: gitclonegit @... method 1: add the file gitadd file name 2. Submit the file to the local data warehouse gitcommit-m for modification reasons 3. Synchronize the file to the master data warehouse gitpush to delete the file gitrm file name Delete the directory gitrm-r file name

Learning Materials: http://progit.org/book/zh/ common operations to get code: git clone git @... file submission method 1. add file git add file name 2. Submit the file to the local data warehouse git commit-m' modify reason 3. Synchronize the file to the master data warehouse git push delete file git rm file name Delete directory git rm-r file name

Learning Materials: http://progit.org/book/zh/


Common Operations


Retrieve the Code:

Git clone git @...


File submission method

1. Add a file

Git add file name

2. Submit to the local data warehouse

Git commit-m' reason for modification'

3. synchronize data to the Master Data Warehouse

Git push


Delete an object

Git rm file name

Delete directory

Git rm-r file name


View logs

Git log

Git log-p view the log and display the difference

Git log-2 shows the last two logs


Compare files

Git diff file name


Cancel added files

Git reset HEAD file


Cancel the previous commit

Git reset HEAD ^


Branch Management and Use


Create Branch

Git branch name

View Branch

Git branch

Git branch-a view all branches (including remote)

Create and switch to Branch

Git checkout-B branch name

Switch to a branch

Git branch name

Delete Branch

Git branch-d branch name


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.