Detailed GIT partition management

Source: Internet
Author: User
This article describes the GIT partition management, people do not understand the GIT partition management or the GIT partition management is interested in, then we will take a look at this article, all right, let's get to the point.

Learn about Git basics and how to use it, so let's start by knowing what the Git partition is. What is the complete submission process? Look first.

For a brief explanation, the directory for this demo is the Gittest directory


The remote GitHub directory is as follows:


First, the GIT partition is divided into three zones, one, the workspace: where the code (file) is edited; Staging area: The place where the files are temporarily cached. Why should there be staging area? In fact, compared to SVN, there is no concept of staging area in SVN, the code is submitted directly from the workspace to the version area, but this has a bad place. In git, the role of staging area is:

1. Protect workspace and version area (version fallback and revocation) in order to avoid some mis-operation in the work process

2. Branch processing possible

To submit test.txt as an example, when the Test.txt development is complete, first view the status of the current workspace through Git status


This time a newly added file is shown in red test.txt, when executing git add test.txt Add the file to the cache and then execute GIT status to view the cache status


The above shows the newly added green file, which indicates that the file has been added to the buffer.

The cache file is then submitted to the version area, and the commit is executed via the git commit-m "commit instructions" command.


When you are finished, you can use the GIT push Origin Master command to submit the version area file to the remote GitHub repository.


This is the time to submit the success! Take a look on GitHub ~ ~ ~


Over~~~ mainly understand the role of three areas, the next operation will be flowing.

The above is all the content of this article, if you are not too familiar with the words, you can realize the two sides are easy to master Oh!

Related recommendations:

Common phrases for Git

How to host your maven project on GitHub

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.