Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the file status in the code working directory in Git

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you what is the status of the files in the working directory of the code in Git. I hope you will get something after reading this article. Let's discuss it together.

The file states in the code working directory include: untracked status (not in git warehouse) and tracked status (already in git warehouse), which are divided into:

1. Untracked status (Untracked)

The file is in the same folder as the git warehouse, but it is not added to the git warehouse and does not participate in version control.

Use the git add command to enter the staged state, and use the git rm-- cached or git reset HEAD command to roll back from the staged state to the untracked state.

2. Unmodified status (Unmodified)

The file is in the git warehouse and has not been modified.

Modify the file to enter the modified state; using the git checkout command, you can fall back from the modified state to the unmodified state.

3. Modified status (Modified)

The file is already in the git warehouse, has been modified, and no other operations have been done.

Use the git add command to enter the staged state, and the git reset HEAD command to roll back from the staged state to the modified state.

4. Temporary status (Staged)

The file is already in the git warehouse and git add has been executed, that is, the temporary storage state.

Using the git commit command, save to the git warehouse and enter the commit state; using the git reset-- soft command, you can fall back from the submitted state to the staging state.

The following figure explains the file-related status in the git library:

After reading this article, I believe you have a certain understanding of "what is the status of the files in the working directory of the code in Git". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for your reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report