博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
git directory structure
阅读量:5936 次
发布时间:2019-06-19

本文共 3360 字,大约阅读时间需要 11 分钟。

hot3.png

A .git directory has a structure similar to the following one:

.#directorys├── branches├── hooks├── info├── logs├── lost-found├── objects├── refs#files├── COMMIT_EDITMSG├── FETCH_HEAD├── HEAD├── ORIG_HEAD├── config├── description├── index└── packed-refs
  • branches

A deprecated way to store shorthands that specify URL to the git fetch, git pull and git push commands is to store a file in branches/<name> and give the name to the command in the place of the repository argument.

  • COMMIT_EDITMSG

This is the last commit message. It’s not actually used by Git at all, but it is for your reference after you have made a commit. user@user:/GIT/test# cat COMMIT_EDITMSG first commit

  • config

This is the main Git configuration file. It keeps specific Git options for your project, such as your remotes, push configurations, tracking branches and more. Your configuration will be loaded first from this file, then from a ~/.gitconfig file and then from an /etc/gitconfig file, if they exist. A exemplary content of this file is: user@user:/GIT/test# cat config [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true [remote "origin"] url = :user/test.git fetch = +refs/heads/:refs/remotes/origin/

  • description

If you’re using gitweb or invoking git instaweb, this will show when you have viewed your repository or the list of all versioned repositories.

  • gitweb

A folder with the GIT web scripts. They allow you to browse the git repository using a web browser.

  • HEAD

This file holds a reference to the branch you are currently on. This tells Git what to use as the parent of your next commit: user@user:/GIT/test# cat HEAD ref: refs/heads/master

  • hooks/

This directory contains shell scripts that are invoked after the corresponding Git commands. For example, after you run a commit, Git will try to execute the post-commit script.

  • index

The Git index is used as a staging area between your working directory and your repository. You can use the index to build up a set of changes that you want to commit together. When you create a commit, what is committed is what is currently in the index, not what is in your working directory. It is a binary file containing a sorted list of path names, each with permissions and the SHA-1 of a blob object. Its content can be listed through: user@user:/GIT/test# git ls-files --stage 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 README

  • info/

Contains additional information about the repository.

  • logs/

Keeps records of changes made to refs.

  • objects/

In this directory the data of your Git objects is stored – all the contents of the files you have ever checked in, your commits, trees and tag objects. The files are stored by their SHA-1 values. The first two characters are for the subdirectory and the next 38 are the filename. For example, if the SHA-1 for a blob we’ve checked in is a576fac355dd17e39fd2671b010e36299f713b4d the path to the corresponding file is: [GIT_DIR]/objects/a5/76fac355dd17e39fd2671b010e36299f713b4d

  • ORIG_HEAD

This is the previous state of HEAD.

  • packed-refs

The file consists of packed heads and tags. It is useful for an efficient repository access.

  • refs/

This directory normally contains three subfolders – heads, remotes and tags. There you will find the corresponding local branches, remote branches and tags files.

转载于:https://my.oschina.net/xieyunzi/blog/346374

你可能感兴趣的文章
怎么解决BarTender因为未检测到IIS安装失败的问题
查看>>
HTML
查看>>
java基础/一个类A继承了类B,那么A就叫做B的派生类或子类,B就叫基类或超类。...
查看>>
洛谷 P3378 【模板】堆
查看>>
python基础知识4——collection类——计数器,有序字典,默认字典,可命名元组,双向队列...
查看>>
关于Handler与异步消息处理循环的摘抄
查看>>
[UOJ79]一般图最大匹配
查看>>
不能ssh连接ubuntu linux 服务器 secureCRT不能ssh连接服务器 不能远程ssh连接虚拟机的ubuntu linux...
查看>>
AS3.0中自定义matedata
查看>>
C语言链表
查看>>
Java环境变量配置
查看>>
装饰器、迭代器、生成器
查看>>
华为实习日记——第二天
查看>>
Pycharm 2017.1 激活服务器
查看>>
HTML基础概念
查看>>
Hadoop构架
查看>>
Nginx的安装
查看>>
PHP下载远程文件及获取文件内容
查看>>
王高利:Redis安装
查看>>
MySQL缓存的查询和清除命令使用详解
查看>>