Skip to content

工作 Directory

一句话解释

工作 directory 是 folder on 你的 disk 哪里你 see and 编辑你的项目 files — 它是 你的 live workspace.

用大白话说

The working directory is the actual folder on your computer where your project files live. When you open your editor and see files, you are looking at the working directory. When you edit a file, you are modifying the working directory.

The working directory is one of Git's three areas. It holds the current state of your files as they exist on disk. Changes here are "unstaged" until you git 添加 them to the staging area.

When you git checkout a different branch, Git updates the working directory to match that branch's files. When you git reset --困难, Git discards all working directory changes and restores files to match the last commit.

示例

bash
# Your files on disk are the working directory
ls
# app.js  config.txt  README.md

# Edit a file — it is now modified in the working directory
echo "new line" >> app.js
git status  # shows app.js as modified

Files on disk 是你的工作 directory. 编辑 show as 修改直到 staged.

相关术语

相关资源

相关课程

解读错误信息

用大白话解释常见错误——什么意思、为什么发生、如何修复。

查看错误

← 返回术语表