返回介绍

5 原理篇

发布于 2024-09-08 19:20:07 字数 3050 浏览 0 评论 0 收藏 0

  • 分布式版本管理。即每个节点即是客户端,也是服务端。也可成为别人的主干树,很适合阶梯式开发管理。
  • Git 是一套内容寻址文件系统。从内部来看,Git 是简单的 key-value 数据存储。它允许插入任意类型的内容,并会返回一个键值,通过该键值可以在任何时候再取出该内容。

GIT API documentation file:///usr/share/doc/git-doc/technical/api-index.html

$ man git

5.1 CONFIGURATION MECHANISM 配置信息 git-config

Starting from 0.99.9 (actually mid 0.99.8.GIT), .git/config file is used to hold per-repository configuration options. It
is a simple text file modeled after .ini format familiar to some people. Here is an example:
# A '#' or ';' character indicates a comment.

; core variables
[core]
; Don't trust file modes
filemode = false
; user identity
[user]
name = "Junio C Hamano"
email = "junkio@twinsun.com"
Various commands read from the configuration file and adjust their operation accordingly.

5.2 IDENTIFIER TERMINOLOGY 存储对象类型

<object>      Indicates the object name for any type of object.
<blob>        Indicates a blob object name.
<tree>        Indicates a tree object name.
<commit>      Indicates a commit object name.
<tree-ish>    Indicates a tree, commit or tag object name. A command that takes a argument ultimately wants to operate                 on a <tree> object but automatically dereferences <commit> and <tag> objects that point at a <tree>.
<commit-ish>  Indicates a commit or tag object name. A command that takes a argument ultimately wants to operate on a              <commit> object but automatically dereferences <tag> objects that point at a <commit>.
<type>          Indicates that an object type is required. Currently one of: blob, tree, commit, or tag.
<file>        Indicates a filename - almost always relative to the root of the tree structure GIT_INDEX_FILE describes.

查看命令

denny@denny-laptop:~/git/unix-center.net/script$ git cat-file -p master^{tree}
040000 tree 39d1ef43324965901826ef8c9e8c0b098487938b    dos
040000 tree 3b47cd6738fdb3fac41b21f678f35b45c14061c7     perl
040000 tree c97f5c664245b841396e49256769f01039fd3ebe    php
040000 tree 5f4276de1d60a512d919a828e5835635414608c5   python_gap

5.3 SYMBOLIC IDENTIFIERS 符号标签

Any git command accepting any <object> can also use the following symbolic notation:
    HEAD
      indicates the head of the current branch (i.e. the contents of $GIT_DIR/HEAD).
    <tag>
      a valid tag name (i.e. the contents of $GIT_DIR/refs/tags/<tag>).
    <head>
      a valid head name (i.e. the contents of $GIT_DIR/refs/heads/<head>).
    For a more complete list of ways to spell object names, see "SPECIFYING REVISIONS" section in git-rev-parse(1).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文