git v_0.99 README翻译

GIT - the stupid content tracker

git 是一个愚蠢的内容追踪器

简介

This is a stupid (but extremely fast) directory content manager. It doesn’t do a whole lot, but what it does do is track directory contents efficiently.
git 是一个愚蠢但是相当有效率的目录内容管理器。它不是把所有事都做了,但是它的本行(追踪目录内容)完成的很有效率。

There are two object abstractions: the “object database”, and the"current directory cache" aka “index”.
存在两种对象的抽象

  • 对象数据库
  • 当前目录缓存 (一般被成为索引)

object database

The Object Database

The object database is literally just a content-addressable collection of objects. All objects are named by their content, which is approximated by the SHA1 hash of the object itself. Objects may refer to other objects (by referencing their SHA1 hash), and so you can build up a hierarchy of objects.

对象数据库实际上是一组对象的按内容寻址的集合。所由的对象由他们的内容命名,这个名称近似于对象本身的SHA1hash码。对象可以引用其他对象的SHA1 hash码,因此你可以构建一个对象的体系结构。

All objects have a statically determined “type” aka “tag”, which is determined at object creation time, and which identifies the format of the object (i.e. how it is used, and how it can refer to other objects). There are currently four different object types: “blob”, “tree”, “commit” and “tag”.

所有的对象都有一个静态确定的类型(一般被称为tag),这个tag在对象创建时确定,同时tag确定了对象的形式,比如对象的使用方式、这个对象是如何引用其他对象的。有四种对象类型,blob、tree、commit和tag。

  • A “blob” object cannot refer to any other object, and is, like the tag implies, a pure storage object containing some user data. It is used to actually store the file data, i.e. a blob object is associated with some particular version of some file.
    blob对象不能引用到任何其他对象,就像它的名称那样,它仅仅是一个储存用户数据的存储对象。blob 一般被用作存储文件数据,也就是说,一个blob对象与一些对象的特定版本有关联。

  • A “tree” object is an object that ties one or more “blob” objects into a directory structure. In addition, a tree object can refer to other tree objects, thus creating a directory hierarchy.
    tree 对象是一个将若干个 blob对象放置到目录结构中的对象。另外,tree对象可以引用到其他的树对象,因此可以构建 目 录 层 次 结 构 {\color{red} 目录层次结构}

  • A “commit” object ties such directory hierarchies together into a DAG of revisions - each “commit” is associated with exactly one tree (the directory hierarchy at the time of the commit). In addition, a “commit” refers to one or more “parent” commit objects that describe the history of how we arrived at that directory hierarchy.
    commit对象将 目 录 层 次 结 构 {\color{red} 目录层次结构} 构成一个版本的有向无环图。每一个commit 都与某一个tree(commit时的目录层次体系)。另外,一个commit与一个或多个描述了我们如何到达目录体系结构的历史的父commit对象有关联。

As a special case, a commit object with no parents is called the “root” object, and is the point of an initial project commit. Each project must have at least one root, and while you can tie several different root objects together into one project by creating a commit object which has two or more separate roots as its ultimate parents, that’s probably just going to confuse people. So aim for the notion of “one root object per project”, even if git itself does not enforce that.
有一个特殊的例子,一个没有父亲的commit对象被称作根对象,而且是初始工程commit时的点。每个项目必须至少有一个root,虽然您可以通过创建一个commit对象将几个不同的root对象绑定到一个工程中,这个commit对象有两个或多个单独的root作为它的最终父亲,但这可能会让人感到困惑。所以注意要保证一个工程一个根,即使git没有强迫要求这件事。

  • A “tag” object symbolically identifies and can be used to sign other objects. It contains the identifier and type of another object, a symbolic name (of course!) and, optionally, a signature.
    tag对象象征性的识别对象,并且可以用作给对象签名。它包含对另外一个对象的识别器和类型,一个象征性的名称(这是必须有的),和一个签名(可以没有)。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值