git-Management Changes

Source: Internet
Author: User
Tags commit diff using git version control system
The first thing you need to know about Git version control is that git tracking manages changes, not files, and that's where git is better than any other version control system. For example, you add a new line, this is a modification, delete a row, which is also a modification, Changed some characters, is also a modification, even create a file is also modified below to begin to explain why git tracking management is modified, not the file, or first through the actual operation of the most intuitive: for example, we still operate the Readme.txt file, here we still add a line of content Git is A distributed version control system. Git is free software distributed under the GPL. Git has a mutable index called stage. Git tracks changes.
Then, modify the Readme.txt file: Git is a distributed version control system. Git is free software distributed under the GPL. Git has a mutable index called stage. Git tracks changes of files.
Submit and view the status (here's a hint that after I've made two modifications to the workspace's Readme.txt file, I'm not using git add directly but using the git commit command):
There's an interesting thing going on here, and the second change hasn't been submitted back to look at our previous operations, and after the first modification to the Readme.txt file we used the git add Readme.txt command, we all know that using git The add command commits one of the file modifications you specified in the workspace to staging area (stage), and after the second modification of the Readme.txt file we use the git commit command to review the git commit command, He commits all the file changes in the staging area to the current branch, so the second time we make a file modification to the Readme.txt is not submitted to the staging area (stage), and the git commit command is only responsible for committing the staging area, so the first modification is submitted, The second modification was not committed
Here's a new command for Git diff:git diff is the workspace and staging area comparison git diff--cached is staging area and a percent comparison commit after using Git diff HEAD--Readme.txt look at the workspace and repository The difference between the latest version of the polygon:
You can see that the second modification did not commit








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.