Staging 区域
一句话解释
staging 区域 (索引) 是 中间 ground 哪里 你 位置 更改 之前 committing 它们 — 它 lets 你 选择 精确地 什么 到 包含 in 每个 提交.
用大白话说
staging 区域是 buffer 之间你的工作 directory and 仓库 history. 当你 运行 git add, 更改 move 从你的工作 directory 到 staging 区域. 当你 运行 git commit, staged changes are saved to history.
The staging area lets you be selective: you can modify five files but only stage and commit two of them. This lets you create focused, atomic commits even when you have multiple unrelated changes in your working directory.
The staging area is also called the "索引" — they are the same thing. git 状态 shows you three sections: unstaged changes (working directory), staged changes (staging area), and committed (history).
示例
# Stage only one file out of many changed
git add important-file.js
git commit -m "Fix important bug"
# The other modified files remain unstaged
git status # shows remaining changes as unstagedgit 添加 moves 更改到 staging 区域; git 提交保存仅 staged 更改.
相关术语
相关资源
相关课程
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。