为什么Git需要设计Index/Stage? [英] Why does Git need to design Index /Stage?

查看:306
本文介绍了为什么Git需要设计Index/Stage?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下图是Git流程图,我很奇怪为什么Git需要设计 Index/Stage .

The following image is Git flow diagram, I'm very strange why Git need to design Index /Stage.

您知道存储库 Workspace 之间的通信是本地的,很容易在存储库 Workspace 之间进行提交或回滚 em>.

You know the communication between Repository and Workspace is local, it's easy to commit or rollback between Repository and Workspace.

为什么Git需要设计Index/Stage?

Why does Git need to design Index /Stage ?

图片

推荐答案

这是对即将提交的更改的预览.您可以逐步地或一次性地在此专用空间中构成将来的提交,检查其中的内容,然后仅在对内容满意时才提交.

This is sort of a preview for changes about to be committed. You can, incrementally or in one go, constitute the future commit in this dedicated space, inspect what's in it, and commit only when you're satisfied with its contents.

有些人几乎忽略了它的存在,从不使用add,依靠-a进行盲目添加所有内容,但是这被认为是不好的做法,因为在更复杂的情况下,当理解时索引 至关重要.

Some people almost ignore its existence and never use add, relying on -a for their commits to add everything blindly, but this is considered bad practice as it sets up future headaches when, in more complex cases, an understanding of the index will be crucial.

我建议您查看,在其他文章中.

I'd suggest looking at this, among other articles.

这篇关于为什么Git需要设计Index/Stage?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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