Git files have three states: 1. Submitted state (committed), indicating that the data has been safely saved in the local database; 2. Modified state (modified), indicating that the file has been modified but has not been saved. to the database; 3. Staged status, which means that the current version of a modified file has been marked so that it will be included in the next submitted snapshot.
The operating environment of this article: Windows 10 system, Git version 2.30.0, Dell G3 computer.
What are the statuses of git files?
There are three statuses of git files:
For the three statuses of Git files, here You need to understand the three work areas of a Git project: workspace, staging area, and Git warehouse.
Knowledge expansion:
The basic Git workflow is described as follows:
Modify something in the workspace some documents.
Take a snapshot of the modified file and then add it to the staging area.
Commit the update and permanently dump the file snapshot saved in the staging area to the Git repository.
GIt has three states before submission: Untracked files (not tracked and monitored), Changes not staged for commit, and Changes to be committed. These three states can be converted at will.
Untracked files: The marked files have not been monitored and managed by git. At this time, you can use the git add command to add files that are prompted as Untracked files to the git warehouse.
Changes to be committed: Files in this status have been snapshotted in the temporary storage area and are waiting to be committed. At this time, you can use git commit -m "comment" to submit the file.
At this time, you can also use the git rm --cached file name command to restore the file status to the Untracked status.
Files in the Changes to be committed state can be submitted or continue to be modified.
Changes not staged for commit: After the file in the Changes to be committed state is not committed and continues to be modified, check through git status and you will have the Changes not staged for commit state. This status indicates that the file has been modified, but has not been placed in the staging area and a snapshot has not been generated. Two operations can be performed at this time, commit and add operations.
If a commit operation is performed, only the files before modification will be submitted to the git version directory (only files in the temporary storage area and files with a status of Changes to be committed can be submitted); if necessary, the modification will be If the subsequent files are also submitted, you need to use the git add command to add the files to the staging area. If you want to undo changes, use: git checkout --filename.
Recommended study: "Git Tutorial"
The above is the detailed content of What are the statuses of git files?. For more information, please follow other related articles on the PHP Chinese website!

The core features of GitHub include version control, branch management, code review, issue tracking and project management. 1. Version control and branch management are based on Git, allowing tracking of code changes and experimental development. 2. Code review is implemented through PullRequest to improve code quality and team collaboration. 3. Issues tracking and project management are carried out through Issues and the project management board to improve project transparency and traceability.

GitHub is a powerful tool to improve the efficiency and quality of software development. 1) Version control: manage code changes through Git. 2) PullRequests: Conduct code review and improve code quality. 3) Issues: Track bugs and project progress. 4) GitHubActions: Automate the construction, testing and deployment process.

Git is a version control system, and GitHub is a Git-based code hosting platform. Git is used to manage code versions and supports local operations; GitHub provides online collaboration tools such as Issue tracking and PullRequest.

Git is an open source distributed version control system that helps developers track file changes, work together and manage code versions. Its core functions include: 1) record code modifications, 2) fallback to previous versions, 3) collaborative development, and 4) create and manage branches for parallel development.

Git and GitHub are not the same thing. Git is a version control system, and GitHub is a Git-based code hosting platform. Git is used to manage code versions, and GitHub provides an online collaboration environment.

The reason for using GitHub to manage HTML projects is that it provides a platform for version control, collaborative development and presentation of works. The specific steps include: 1. Create and initialize the Git repository, 2. Add and submit HTML files, 3. Push to GitHub, 4. Use GitHubPages to deploy web pages, 5. Use GitHubActions to automate building and deployment. In addition, GitHub also supports code review, Issue and PullRequest features to help optimize and collaborate on HTML projects.

Starting from Git is more suitable for a deep understanding of version control principles, and starting from GitHub is more suitable for focusing on collaboration and code hosting. 1.Git is a distributed version control system that helps manage code version history. 2. GitHub is an online platform based on Git, providing code hosting and collaboration capabilities.

Microsoft does not own Git, but owns GitHub. 1.Git is a distributed version control system created by Linus Torvaz in 2005. 2. GitHub is an online code hosting platform based on Git. It was founded in 2008 and acquired by Microsoft in 2018.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version
Visual web development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.