Git manual/git Tutorial: Git Status View the changes in the local workspace, registers files __git

Source: Internet
Author: User
Tags diff git clone

Related articles: about verifying that there is an SSH configuration and how to generate SSH key can refer to the article: Git usage manual: Generate SSH Key
For the use of SSH key and the configuration of the public key in GitHub, Gitlab, please refer to the article: Git manual: Use SSH key and configure the SSH key public key to the concepts and relationships of Git workspaces, registers, local warehouses, remote warehouses, Please refer to the article: Git Manual: Workspaces, registers, local warehouses, remote warehouses about git downloading items from a remote repository to a local workspace, see article: Git manual: Git clone download Remote warehouse Project project to local workspace for Git branch usage details, Please refer to the article: Git Manual: Git branch Branch operations, create a branch, view a branch, delete a branch, delete a local branch, delete a remote branch

For the use of Git checkout, please refer to the article: Git manual: Git checkout Create branches, toggle branches

For the use of Git diff and git add commands, please refer to the article: Git Usage manual: Git diff, git Add, git diff--cached command details

For a detailed explanation of git commit commands, please refer to the article: Git manual: Git commit-m/-am/-a-m submit files to local warehouse area

For a git fetch command, refer to the article: Git manual: Git fetch pulls the latest version of the branch and branch of the remote warehouse to the local

For more information about git pull command use, please refer to article: Git manual: Git pull origin pull substitution code to local, resolve file conflicts when pulling out code

For a git push command use, please refer to article: Git manual: Git push forward submit local warehouse code file to remote warehouse

For the use of git log commands, please refer to the article: Git manual/git Tutorial: git log view git commit log


to view the modification status of a file in a local workspace, registers

Command: Git status

If you do not modify the file, the following instructions appear after the command:


Then we add a file to the project and edit it:


After the git status command is executed again, the following figure appears:


From the diagram we can see a red and two green tips.

The first green hint is prefixed by newfile, which is represented as the new xxx file.

The second green hint is prefixed by deleted, which is indicated as deleting the xxx file.

The red hint is prefixed with modified, which is indicated as modifying the xxx file.

Orange Box selected Tips changes tobe committed, meaning that the following files have been deposited in registers and are submitted to the local warehouse when they are submitted to the local warehouse.

The Red box-selected section prompts Changesnot staged for commit, meaning that the following file is not deposited in registers, and the following files are not committed to the local warehouse if the-a parameter is not used when the commit is used.

Sometimes, when we perform git status, we also experience the following red box tips:


Tip untracked files have the same meaning as the prompt changes not staged for commit, which means the following files have not been added to the registers. The difference, however, is that you are prompted untracked files to add files to the local warehouse using the git commit–am command, as shown in the figure:


Either git commit–m "this submission" or Git commit–am "This submission description" cannot submit the file to the local repository and must execute git Add. command, save the file in registers, and then execute the submit command before submitting the file to the local repository.


From this we can see that when you modify a file in your local workspace, use the git status command to see what files are involved in this modification (add, delete, modify), and you can see the files that have been saved in the registers for changes that have been made to make it easier to check which files are specifically modified. Lest there be any omission.




If you have other questions, I hope that through the form of a message to communicate in a timely manner, there are written errors and can be optimized places also hope to make timely, thank you.

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.