分段和缓存有什么区别? [英] What is the difference between staging and caching?

查看:148
本文介绍了分段和缓存有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读 Pro Git,第二版这本书。

它在第21页上说:


git diff --staged

以及稍后的页面(没有解释缓存意味着什么)

and a page later (without explaining what cached means)


git diff --cached 查看您迄今为止已上演的内容。

git diff --cached to see what you've staged so far.

现在我有点迷路了。分段和缓存有什么区别?

and now I'm a bit lost. What is the difference between staging and caching?

推荐答案

分段区域或缓存在Git的大多数其他上下文中有另一个名字的东西:索引

The "staging area", or "cache" are both synonyms for the same thing which has another name in most other contexts in Git: The index.

索引是变更 / em>使用 git add (或 git rm )添加它们。它是当您执行 git commit 时提交的一组更改。

The index is the area where changes are staged when you add them using git add (or git rm). It’s the set of changes that is committed when you do git commit.

这三个名称通常用作同义词,尽管在 git diff 中的 - cached 参数之外很少使用cache。

All three names are usually used synonymously, although "cache" is rarely used outside of the --cached parameter in git diff.

这篇关于分段和缓存有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆